You need to set the pointer mode to device before the second call to cublasSasum:
cublasSetPointerMode(cublas_handle, CUBLAS_POINTER_MODE_DEVICE);
res=10.000000
d_res=10.000000
You need to set the pointer mode to device before the second call to cublasSasum:
cublasSetPointerMode(cublas_handle, CUBLAS_POINTER_MODE_DEVICE);
res=10.000000
d_res=10.000000