- 在cuda doc中查找函數。
CudaDeviceSynchronize
描述here爲:
__host__ __device__ cudaError_t cudaDeviceSynchronize (void)
所以你的錯誤代碼75是cudaError_t
類型。
查找cudaError_t
在cuda頭文件中定義枚舉。它在include/driver_types.h
。並得到了錯誤75
:
/**
* While executing a kernel, the device encountered an instruction
* which can only operate on memory locations in certain address spaces
* (global, shared, or local), but was supplied a memory address not
* belonging to an allowed address space.
* The context cannot be used, so it must be destroyed (and a new one should be created).
* All existing device memory allocations from this context are invalid
* and must be reconstructed if the program is to continue using CUDA.
*/
cudaErrorInvalidAddressSpace = 75,
你剛剛得知一個人如何釣魚:)謝謝!我將一個本地聲明的非指針變量賦值給全局數組的一個元素。 – Ardeshir81