主持人:
unsigned char exp[128];
unsigned char __e;
i = cudaMalloc( (void**)&__e, 128 * sizeof(unsigned char) );
if(i != cudaSuccess)
printf("cudaMalloc __e FAIL! Code: %d\n", i);
BN_bn2bin128B(e, exp); // copy data from e to exp, no problems since here
i = cudaMemcpy( &__e, &exp, 128 * sizeof(unsigned char), cudaMemcpyHostToDevice);
if(i != cudaSuccess)
printf("cudaMemcpy __e FAIL! Code: %d\n", i);
输出:
cudaMemcpy __e FAIL! Code: 11
错误 11 对应于:
cudaErrorInvalidValue = 11, ///< Invalid value
为什么?错误在哪里?