I have been checked the sample codes of CUDA7.0.
I have one question to ask about bandwithTest code.
I found the code as blow in bandwithTest code.
//pinned memory mode - use special function to get OS-pinned memory
#if CUDART_VERSION >= 2020
checkCudaErrors(cudaHostAlloc((void **)&h_idata, memSize, (wc) ? cudaHostAllocWriteCombined :0));
checkCudaErrors(cudaHostAlloc((void **)&h_odata, memSize, (wc) ? cudaHostAllocWriteCombined :0));
#else
checkCudaErrors(cudaMallocHost((void **)&h_idata, memSize));
checkCudaErrors(cudaMallocHost((void **)&h_odata, memSize));
It seems like that we must change CUDA API function according with CUDART_VERSION.
if CUDART_VERSION >=2020 : We must use cudaHostAlloc()
if CUDART_VERSION < 2020 : We musr use cudaMallocHost()
Is it mandatory?
I’d really appriciate it if anyone will reply soon.
Regards,