From fda3b7b1ca0ed0b65dc030ea1dca83c33898612f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=A2=9E=E8=BE=89?= <3045316072@qq.com> Date: Fri, 21 Mar 2025 17:31:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GPUBaseLib/GPUTool/GPUTool.cu | 2 +- GPUBaseLib/GPUTool/GPUTool.cuh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 -> 设备