diff --git a/GPUBaseLib/GPUTool/GPUTool.cu b/GPUBaseLib/GPUTool/GPUTool.cu index 0a8c652..5891175 100644 --- a/GPUBaseLib/GPUTool/GPUTool.cu +++ b/GPUBaseLib/GPUTool/GPUTool.cu @@ -354,7 +354,7 @@ extern "C" void FreeCUDAHost(void* ptr) { } // 多GPU内存分配函数 -void* mallocCUDADevice(size_t memsize, int device_id = 0) +void* mallocCUDADevice(size_t memsize, int device_id ) { void* ptr = nullptr; cudaError_t err; diff --git a/GPUBaseLib/GPUTool/GPUTool.cuh b/GPUBaseLib/GPUTool/GPUTool.cuh index d16af3c..2a9a709 100644 --- a/GPUBaseLib/GPUTool/GPUTool.cuh +++ b/GPUBaseLib/GPUTool/GPUTool.cuh @@ -77,7 +77,7 @@ extern "C" GPUBASELIBAPI void checkCudaError(cudaError_t err, const char* msg); // GPU 内存函数 extern "C" GPUBASELIBAPI void* mallocCUDAHost(size_t memsize); // 主机内存声明 extern "C" GPUBASELIBAPI void FreeCUDAHost(void* ptr); -extern "C" GPUBASELIBAPI void* mallocCUDADevice(size_t memsize); // GPU内存声明 +extern "C" GPUBASELIBAPI void* mallocCUDADevice(size_t memsize, int device_id = 0); // GPU内存声明 extern "C" GPUBASELIBAPI void FreeCUDADevice(void* ptr); extern "C" GPUBASELIBAPI void HostToDevice(void* hostptr, void* deviceptr, size_t memsize);//GPU 内存数据转移 设备 -> GPU extern "C" GPUBASELIBAPI void DeviceToHost(void* hostptr, void* deviceptr, size_t memsize);//GPU 内存数据转移 GPU -> 设备