문제

in many cublas or cusparse function calls, they use scalar variables which we can pass in either host pointer or device pointer, such as the alpha and beta variable here http://docs.nvidia.com/cuda/cublas/#cublas-lt-t-gt-gemm

How is this actually implemented? If the data is in host, I assume it would need to allocate memory on device and then call cudaMemcpyAsync to copy the data. However, doing cudaMalloc would make the function call synchronous. How can we solve this problem?

도움이 되었습니까?

해결책

If its a host resident scalar it can be passed by value as a kernel parameter. If it's device resident then a pointer to it can be passed as a kernel parameter.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top