From 34408c3122f9eeb1b952a50bedf4523093794e00 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Thu, 13 Apr 2017 09:16:58 -0700 Subject: [PATCH] client: don't start var names with __ --- client/gpu_amd.cpp | 108 +++++++++++----------- client/gpu_nvidia.cpp | 202 +++++++++++++++++++++--------------------- client/gpu_opencl.cpp | 94 ++++++++++---------- 3 files changed, 202 insertions(+), 202 deletions(-) diff --git a/client/gpu_amd.cpp b/client/gpu_amd.cpp index 966ddb0241..ec594a09b8 100644 --- a/client/gpu_amd.cpp +++ b/client/gpu_amd.cpp @@ -85,27 +85,27 @@ typedef int (__stdcall *ATI_STATUS) (CALdevicestatus*, CALdevice); typedef int (__stdcall *ATI_DEVICEOPEN) (CALdevice*, CALuint); typedef int (__stdcall *ATI_DEVICECLOSE) (CALdevice); -ATI_ATTRIBS __calDeviceGetAttribs = NULL; -ATI_CLOSE __calShutdown = NULL; -ATI_GDC __calDeviceGetCount = NULL; -ATI_GDI __calInit = NULL; -ATI_INFO __calDeviceGetInfo = NULL; -ATI_VER __calGetVersion = NULL; -ATI_STATUS __calDeviceGetStatus = NULL; -ATI_DEVICEOPEN __calDeviceOpen = NULL; -ATI_DEVICECLOSE __calDeviceClose = NULL; +ATI_ATTRIBS p_calDeviceGetAttribs = NULL; +ATI_CLOSE p_calShutdown = NULL; +ATI_GDC p_calDeviceGetCount = NULL; +ATI_GDI p_calInit = NULL; +ATI_INFO p_calDeviceGetInfo = NULL; +ATI_VER p_calGetVersion = NULL; +ATI_STATUS p_calDeviceGetStatus = NULL; +ATI_DEVICEOPEN p_calDeviceOpen = NULL; +ATI_DEVICECLOSE p_calDeviceClose = NULL; #else -int (*__calInit)(); -int (*__calGetVersion)(CALuint*, CALuint*, CALuint*); -int (*__calDeviceGetCount)(CALuint*); -int (*__calDeviceGetAttribs)(CALdeviceattribs*, CALuint); -int (*__calShutdown)(); -int (*__calDeviceGetInfo)(CALdeviceinfo*, CALuint); -int (*__calDeviceGetStatus)(CALdevicestatus*, CALdevice); -int (*__calDeviceOpen)(CALdevice*, CALuint); -int (*__calDeviceClose)(CALdevice); +int (*p_calInit)(); +int (*p_calGetVersion)(CALuint*, CALuint*, CALuint*); +int (*p_calDeviceGetCount)(CALuint*); +int (*p_calDeviceGetAttribs)(CALdeviceattribs*, CALuint); +int (*p_calShutdown)(); +int (*p_calDeviceGetInfo)(CALdeviceinfo*, CALuint); +int (*p_calDeviceGetStatus)(CALdevicestatus*, CALdevice); +int (*p_calDeviceOpen)(CALdevice*, CALuint); +int (*p_calDeviceClose)(CALdevice); #endif @@ -146,15 +146,15 @@ void COPROC_ATI::get( return; } - __calInit = (ATI_GDI)GetProcAddress(callib, "calInit" ); - __calGetVersion = (ATI_VER)GetProcAddress(callib, "calGetVersion" ); - __calDeviceGetCount = (ATI_GDC)GetProcAddress(callib, "calDeviceGetCount" ); - __calDeviceGetAttribs =(ATI_ATTRIBS)GetProcAddress(callib, "calDeviceGetAttribs" ); - __calShutdown = (ATI_CLOSE)GetProcAddress(callib, "calShutdown" ); - __calDeviceGetInfo = (ATI_INFO)GetProcAddress(callib, "calDeviceGetInfo" ); - __calDeviceGetStatus = (ATI_STATUS)GetProcAddress(callib, "calDeviceGetStatus" ); - __calDeviceOpen = (ATI_DEVICEOPEN)GetProcAddress(callib, "calDeviceOpen" ); - __calDeviceClose = (ATI_DEVICECLOSE)GetProcAddress(callib, "calDeviceClose" ); + p_calInit = (ATI_GDI)GetProcAddress(callib, "calInit" ); + p_calGetVersion = (ATI_VER)GetProcAddress(callib, "calGetVersion" ); + p_calDeviceGetCount = (ATI_GDC)GetProcAddress(callib, "calDeviceGetCount" ); + p_calDeviceGetAttribs =(ATI_ATTRIBS)GetProcAddress(callib, "calDeviceGetAttribs" ); + p_calShutdown = (ATI_CLOSE)GetProcAddress(callib, "calShutdown" ); + p_calDeviceGetInfo = (ATI_INFO)GetProcAddress(callib, "calDeviceGetInfo" ); + p_calDeviceGetStatus = (ATI_STATUS)GetProcAddress(callib, "calDeviceGetStatus" ); + p_calDeviceOpen = (ATI_DEVICEOPEN)GetProcAddress(callib, "calDeviceOpen" ); + p_calDeviceClose = (ATI_DEVICECLOSE)GetProcAddress(callib, "calDeviceClose" ); #else @@ -167,52 +167,52 @@ void COPROC_ATI::get( atirt_detected = true; - __calInit = (int(*)()) dlsym(callib, "calInit"); - __calGetVersion = (int(*)(CALuint*, CALuint*, CALuint*)) dlsym(callib, "calGetVersion"); - __calDeviceGetCount = (int(*)(CALuint*)) dlsym(callib, "calDeviceGetCount"); - __calDeviceGetAttribs = (int(*)(CALdeviceattribs*, CALuint)) dlsym(callib, "calDeviceGetAttribs"); - __calShutdown = (int(*)()) dlsym(callib, "calShutdown"); - __calDeviceGetInfo = (int(*)(CALdeviceinfo*, CALuint)) dlsym(callib, "calDeviceGetInfo"); - __calDeviceGetStatus = (int(*)(CALdevicestatus*, CALdevice)) dlsym(callib, "calDeviceGetStatus"); - __calDeviceOpen = (int(*)(CALdevice*, CALuint)) dlsym(callib, "calDeviceOpen"); - __calDeviceClose = (int(*)(CALdevice)) dlsym(callib, "calDeviceClose"); + p_calInit = (int(*)()) dlsym(callib, "calInit"); + p_calGetVersion = (int(*)(CALuint*, CALuint*, CALuint*)) dlsym(callib, "calGetVersion"); + p_calDeviceGetCount = (int(*)(CALuint*)) dlsym(callib, "calDeviceGetCount"); + p_calDeviceGetAttribs = (int(*)(CALdeviceattribs*, CALuint)) dlsym(callib, "calDeviceGetAttribs"); + p_calShutdown = (int(*)()) dlsym(callib, "calShutdown"); + p_calDeviceGetInfo = (int(*)(CALdeviceinfo*, CALuint)) dlsym(callib, "calDeviceGetInfo"); + p_calDeviceGetStatus = (int(*)(CALdevicestatus*, CALdevice)) dlsym(callib, "calDeviceGetStatus"); + p_calDeviceOpen = (int(*)(CALdevice*, CALuint)) dlsym(callib, "calDeviceOpen"); + p_calDeviceClose = (int(*)(CALdevice)) dlsym(callib, "calDeviceClose"); #endif - if (!__calInit) { + if (!p_calInit) { warnings.push_back("calInit() missing from CAL library"); goto leave; } - if (!__calGetVersion) { + if (!p_calGetVersion) { warnings.push_back("calGetVersion() missing from CAL library"); goto leave; } - if (!__calDeviceGetCount) { + if (!p_calDeviceGetCount) { warnings.push_back("calDeviceGetCount() missing from CAL library"); goto leave; } - if (!__calDeviceGetAttribs) { + if (!p_calDeviceGetAttribs) { warnings.push_back("calDeviceGetAttribs() missing from CAL library"); goto leave; } - if (!__calDeviceGetInfo) { + if (!p_calDeviceGetInfo) { warnings.push_back("calDeviceGetInfo() missing from CAL library"); goto leave; } - retval = (*__calInit)(); + retval = (*p_calInit)(); if (retval != CAL_RESULT_OK) { snprintf(buf, sizeof(buf), "calInit() returned %d", retval); warnings.push_back(buf); goto leave; } - retval = (*__calDeviceGetCount)(&numDevices); + retval = (*p_calDeviceGetCount)(&numDevices); if (retval != CAL_RESULT_OK) { snprintf(buf, sizeof(buf), "calDeviceGetCount() returned %d", retval); warnings.push_back(buf); goto leave; } - retval = (*__calGetVersion)(&cal_major, &cal_minor, &cal_imp); + retval = (*p_calGetVersion)(&cal_major, &cal_minor, &cal_imp); if (retval != CAL_RESULT_OK) { snprintf(buf, sizeof(buf), "calGetVersion() returned %d", retval); warnings.push_back(buf); @@ -225,13 +225,13 @@ void COPROC_ATI::get( } for (CALuint i=0; i& warnings) { st.struct_size = sizeof(CALdevicestatus); - if (!__calDeviceOpen) { + if (!p_calDeviceOpen) { warnings.push_back("calDeviceOpen() missing from CAL library"); return; } - if (!__calDeviceGetStatus) { + if (!p_calDeviceGetStatus) { warnings.push_back("calDeviceGetStatus() missing from CAL library"); return; } - if (!__calDeviceClose) { + if (!p_calDeviceClose) { warnings.push_back("calDeviceClose() missing from CAL library"); return; } - retval = (*__calDeviceOpen)(&dev, cc.device_num); + retval = (*p_calDeviceOpen)(&dev, cc.device_num); if (retval) { snprintf(buf, sizeof(buf), "[coproc] calDeviceOpen(%d) returned %d", cc.device_num, retval @@ -488,16 +488,16 @@ static void get_available_ati_ram(COPROC_ATI &cc, vector& warnings) { warnings.push_back(buf); return; } - retval = (*__calDeviceGetStatus)(&st, dev); + retval = (*p_calDeviceGetStatus)(&st, dev); if (retval) { snprintf(buf, sizeof(buf), "[coproc] calDeviceGetStatus(%d) returned %d", cc.device_num, retval ); warnings.push_back(buf); - (*__calDeviceClose)(dev); + (*p_calDeviceClose)(dev); return; } cc.available_ram = st.availLocalRAM*MEGA; - (*__calDeviceClose)(dev); + (*p_calDeviceClose)(dev); } diff --git a/client/gpu_nvidia.cpp b/client/gpu_nvidia.cpp index 15d015ce97..21e7df607c 100644 --- a/client/gpu_nvidia.cpp +++ b/client/gpu_nvidia.cpp @@ -201,33 +201,33 @@ typedef int (__stdcall *CUDA_MA)(unsigned int*, size_t); typedef int (__stdcall *CUDA_MF)(unsigned int); typedef int (__stdcall *CUDA_MGI)(size_t*, size_t*); -CUDA_GDC __cuDeviceGetCount = NULL; -CUDA_GDV __cuDriverGetVersion = NULL; -CUDA_GDI __cuInit = NULL; -CUDA_GDG __cuDeviceGet = NULL; -CUDA_GDA __cuDeviceGetAttribute = NULL; -CUDA_GDN __cuDeviceGetName = NULL; -CUDA_GDM __cuDeviceTotalMem = NULL; -CUDA_GDCC __cuDeviceComputeCapability = NULL; -CUDA_CC __cuCtxCreate = NULL; -CUDA_CD __cuCtxDestroy = NULL; -CUDA_MA __cuMemAlloc = NULL; -CUDA_MF __cuMemFree = NULL; -CUDA_MGI __cuMemGetInfo = NULL; +CUDA_GDC p_cuDeviceGetCount = NULL; +CUDA_GDV p_cuDriverGetVersion = NULL; +CUDA_GDI p_cuInit = NULL; +CUDA_GDG p_cuDeviceGet = NULL; +CUDA_GDA p_cuDeviceGetAttribute = NULL; +CUDA_GDN p_cuDeviceGetName = NULL; +CUDA_GDM p_cuDeviceTotalMem = NULL; +CUDA_GDCC p_cuDeviceComputeCapability = NULL; +CUDA_CC p_cuCtxCreate = NULL; +CUDA_CD p_cuCtxDestroy = NULL; +CUDA_MA p_cuMemAlloc = NULL; +CUDA_MF p_cuMemFree = NULL; +CUDA_MGI p_cuMemGetInfo = NULL; #else -int (*__cuInit)(unsigned int); -int (*__cuDeviceGetCount)(int*); -int (*__cuDriverGetVersion)(int*); -int (*__cuDeviceGet)(int*, int); -int (*__cuDeviceGetAttribute)(int*, int, int); -int (*__cuDeviceGetName)(char*, int, int); -int (*__cuDeviceTotalMem)(size_t*, int); -int (*__cuDeviceComputeCapability)(int*, int*, int); -int (*__cuCtxCreate)(void**, unsigned int, unsigned int); -int (*__cuCtxDestroy)(void*); -int (*__cuMemAlloc)(unsigned int*, size_t); -int (*__cuMemFree)(unsigned int); -int (*__cuMemGetInfo)(size_t*, size_t*); +int (*p_cuInit)(unsigned int); +int (*p_cuDeviceGetCount)(int*); +int (*p_cuDriverGetVersion)(int*); +int (*p_cuDeviceGet)(int*, int); +int (*p_cuDeviceGetAttribute)(int*, int, int); +int (*p_cuDeviceGetName)(char*, int, int); +int (*p_cuDeviceTotalMem)(size_t*, int); +int (*p_cuDeviceComputeCapability)(int*, int*, int); +int (*p_cuCtxCreate)(void**, unsigned int, unsigned int); +int (*p_cuCtxDestroy)(void*); +int (*p_cuMemAlloc)(unsigned int*, size_t); +int (*p_cuMemFree)(unsigned int); +int (*p_cuMemGetInfo)(size_t*, size_t*); #endif // NVIDIA interfaces are documented here: @@ -248,19 +248,19 @@ void COPROC_NVIDIA::get( warnings.push_back("No NVIDIA library found"); return; } - __cuDeviceGetCount = (CUDA_GDC)GetProcAddress( cudalib, "cuDeviceGetCount" ); - __cuDriverGetVersion = (CUDA_GDV)GetProcAddress( cudalib, "cuDriverGetVersion" ); - __cuInit = (CUDA_GDI)GetProcAddress( cudalib, "cuInit" ); - __cuDeviceGet = (CUDA_GDG)GetProcAddress( cudalib, "cuDeviceGet" ); - __cuDeviceGetAttribute = (CUDA_GDA)GetProcAddress( cudalib, "cuDeviceGetAttribute" ); - __cuDeviceGetName = (CUDA_GDN)GetProcAddress( cudalib, "cuDeviceGetName" ); - __cuDeviceTotalMem = (CUDA_GDM)GetProcAddress( cudalib, "cuDeviceTotalMem" ); - __cuDeviceComputeCapability = (CUDA_GDCC)GetProcAddress( cudalib, "cuDeviceComputeCapability" ); - __cuCtxCreate = (CUDA_CC)GetProcAddress( cudalib, "cuCtxCreate" ); - __cuCtxDestroy = (CUDA_CD)GetProcAddress( cudalib, "cuCtxDestroy" ); - __cuMemAlloc = (CUDA_MA)GetProcAddress( cudalib, "cuMemAlloc" ); - __cuMemFree = (CUDA_MF)GetProcAddress( cudalib, "cuMemFree" ); - __cuMemGetInfo = (CUDA_MGI)GetProcAddress( cudalib, "cuMemGetInfo" ); + p_cuDeviceGetCount = (CUDA_GDC)GetProcAddress( cudalib, "cuDeviceGetCount" ); + p_cuDriverGetVersion = (CUDA_GDV)GetProcAddress( cudalib, "cuDriverGetVersion" ); + p_cuInit = (CUDA_GDI)GetProcAddress( cudalib, "cuInit" ); + p_cuDeviceGet = (CUDA_GDG)GetProcAddress( cudalib, "cuDeviceGet" ); + p_cuDeviceGetAttribute = (CUDA_GDA)GetProcAddress( cudalib, "cuDeviceGetAttribute" ); + p_cuDeviceGetName = (CUDA_GDN)GetProcAddress( cudalib, "cuDeviceGetName" ); + p_cuDeviceTotalMem = (CUDA_GDM)GetProcAddress( cudalib, "cuDeviceTotalMem" ); + p_cuDeviceComputeCapability = (CUDA_GDCC)GetProcAddress( cudalib, "cuDeviceComputeCapability" ); + p_cuCtxCreate = (CUDA_CC)GetProcAddress( cudalib, "cuCtxCreate" ); + p_cuCtxDestroy = (CUDA_CD)GetProcAddress( cudalib, "cuCtxDestroy" ); + p_cuMemAlloc = (CUDA_MA)GetProcAddress( cudalib, "cuMemAlloc" ); + p_cuMemFree = (CUDA_MF)GetProcAddress( cudalib, "cuMemFree" ); + p_cuMemGetInfo = (CUDA_MGI)GetProcAddress( cudalib, "cuMemGetInfo" ); #ifndef SIM NvAPI_Initialize(); @@ -297,65 +297,65 @@ void* cudalib = NULL; warnings.push_back(buf); return; } - __cuDeviceGetCount = (int(*)(int*)) dlsym(cudalib, "cuDeviceGetCount"); - __cuDriverGetVersion = (int(*)(int*)) dlsym( cudalib, "cuDriverGetVersion" ); - __cuInit = (int(*)(unsigned int)) dlsym( cudalib, "cuInit" ); - __cuDeviceGet = (int(*)(int*, int)) dlsym( cudalib, "cuDeviceGet" ); - __cuDeviceGetAttribute = (int(*)(int*, int, int)) dlsym( cudalib, "cuDeviceGetAttribute" ); - __cuDeviceGetName = (int(*)(char*, int, int)) dlsym( cudalib, "cuDeviceGetName" ); - __cuDeviceTotalMem = (int(*)(size_t*, int)) dlsym( cudalib, "cuDeviceTotalMem" ); - __cuDeviceComputeCapability = (int(*)(int*, int*, int)) dlsym( cudalib, "cuDeviceComputeCapability" ); - __cuCtxCreate = (int(*)(void**, unsigned int, unsigned int)) dlsym( cudalib, "cuCtxCreate" ); - __cuCtxDestroy = (int(*)(void*)) dlsym( cudalib, "cuCtxDestroy" ); - __cuMemAlloc = (int(*)(unsigned int*, size_t)) dlsym( cudalib, "cuMemAlloc" ); - __cuMemFree = (int(*)(unsigned int)) dlsym( cudalib, "cuMemFree" ); - __cuMemGetInfo = (int(*)(size_t*, size_t*)) dlsym( cudalib, "cuMemGetInfo" ); + p_cuDeviceGetCount = (int(*)(int*)) dlsym(cudalib, "cuDeviceGetCount"); + p_cuDriverGetVersion = (int(*)(int*)) dlsym( cudalib, "cuDriverGetVersion" ); + p_cuInit = (int(*)(unsigned int)) dlsym( cudalib, "cuInit" ); + p_cuDeviceGet = (int(*)(int*, int)) dlsym( cudalib, "cuDeviceGet" ); + p_cuDeviceGetAttribute = (int(*)(int*, int, int)) dlsym( cudalib, "cuDeviceGetAttribute" ); + p_cuDeviceGetName = (int(*)(char*, int, int)) dlsym( cudalib, "cuDeviceGetName" ); + p_cuDeviceTotalMem = (int(*)(size_t*, int)) dlsym( cudalib, "cuDeviceTotalMem" ); + p_cuDeviceComputeCapability = (int(*)(int*, int*, int)) dlsym( cudalib, "cuDeviceComputeCapability" ); + p_cuCtxCreate = (int(*)(void**, unsigned int, unsigned int)) dlsym( cudalib, "cuCtxCreate" ); + p_cuCtxDestroy = (int(*)(void*)) dlsym( cudalib, "cuCtxDestroy" ); + p_cuMemAlloc = (int(*)(unsigned int*, size_t)) dlsym( cudalib, "cuMemAlloc" ); + p_cuMemFree = (int(*)(unsigned int)) dlsym( cudalib, "cuMemFree" ); + p_cuMemGetInfo = (int(*)(size_t*, size_t*)) dlsym( cudalib, "cuMemGetInfo" ); #endif - if (!__cuDriverGetVersion) { + if (!p_cuDriverGetVersion) { warnings.push_back("cuDriverGetVersion() missing from NVIDIA library"); goto leave; } - if (!__cuInit) { + if (!p_cuInit) { warnings.push_back("cuInit() missing from NVIDIA library"); goto leave; } - if (!__cuDeviceGetCount) { + if (!p_cuDeviceGetCount) { warnings.push_back("cuDeviceGetCount() missing from NVIDIA library"); goto leave; } - if (!__cuDeviceGet) { + if (!p_cuDeviceGet) { warnings.push_back("cuDeviceGet() missing from NVIDIA library"); goto leave; } - if (!__cuDeviceGetAttribute) { + if (!p_cuDeviceGetAttribute) { warnings.push_back("cuDeviceGetAttribute() missing from NVIDIA library"); goto leave; } - if (!__cuDeviceTotalMem) { + if (!p_cuDeviceTotalMem) { warnings.push_back("cuDeviceTotalMem() missing from NVIDIA library"); goto leave; } - if (!__cuDeviceComputeCapability) { + if (!p_cuDeviceComputeCapability) { warnings.push_back("cuDeviceComputeCapability() missing from NVIDIA library"); goto leave; } - if (!__cuMemAlloc) { + if (!p_cuMemAlloc) { warnings.push_back("cuMemAlloc() missing from NVIDIA library"); goto leave; } - if (!__cuMemFree) { + if (!p_cuMemFree) { warnings.push_back("cuMemFree() missing from NVIDIA library"); goto leave; } - retval = (*__cuInit)(0); + retval = (*p_cuInit)(0); #ifdef __APPLE__ // If system is just booting, CUDA driver may not be ready yet if (retval) { if (get_system_uptime() < 300) { // Retry only if system has been up for under 5 minutes for (int retryCount=0; retryCount<120; retryCount++) { - retval = (*__cuInit)(0); + retval = (*p_cuInit)(0); if (!retval) break; boinc_sleep(1.); continue; @@ -370,7 +370,7 @@ void* cudalib = NULL; goto leave; } - retval = (*__cuDriverGetVersion)(&cuda_version); + retval = (*p_cuDriverGetVersion)(&cuda_version); if (retval) { sprintf(buf, "cuDriverGetVersion() returned %d", retval); warnings.push_back(buf); @@ -379,7 +379,7 @@ void* cudalib = NULL; have_cuda = true; - retval = (*__cuDeviceGetCount)(&cuda_ndevs); + retval = (*p_cuDeviceGetCount)(&cuda_ndevs); if (retval) { sprintf(buf, "cuDeviceGetCount() returned %d", retval); warnings.push_back(buf); @@ -391,44 +391,44 @@ void* cudalib = NULL; for (j=0; j 100) continue; // e.g. 9999 is an error #if defined(_WIN32) && !defined(SIM) @@ -539,24 +539,24 @@ static void get_available_nvidia_ram(COPROC_NVIDIA &cc, vector& warnings char buf[256]; cc.available_ram = cc.prop.totalGlobalMem; - if (!__cuDeviceGet) { + if (!p_cuDeviceGet) { warnings.push_back("cuDeviceGet() missing from NVIDIA library"); return; } - if (!__cuCtxCreate) { + if (!p_cuCtxCreate) { warnings.push_back("cuCtxCreate() missing from NVIDIA library"); return; } - if (!__cuCtxDestroy) { + if (!p_cuCtxDestroy) { warnings.push_back("cuCtxDestroy() missing from NVIDIA library"); return; } - if (!__cuMemGetInfo) { + if (!p_cuMemGetInfo) { warnings.push_back("cuMemGetInfo() missing from NVIDIA library"); return; } - retval = (*__cuDeviceGet)(&device, cc.device_num); + retval = (*p_cuDeviceGet)(&device, cc.device_num); if (retval) { snprintf(buf, sizeof(buf), "[coproc] cuDeviceGet(%d) returned %d", cc.device_num, retval @@ -564,7 +564,7 @@ static void get_available_nvidia_ram(COPROC_NVIDIA &cc, vector& warnings warnings.push_back(buf); return; } - retval = (*__cuCtxCreate)(&ctx, 0, device); + retval = (*p_cuCtxCreate)(&ctx, 0, device); if (retval) { snprintf(buf, sizeof(buf), "[coproc] cuCtxCreate(%d) returned %d", cc.device_num, retval @@ -572,16 +572,16 @@ static void get_available_nvidia_ram(COPROC_NVIDIA &cc, vector& warnings warnings.push_back(buf); return; } - retval = (*__cuMemGetInfo)(&memfree, &memtotal); + retval = (*p_cuMemGetInfo)(&memfree, &memtotal); if (retval) { snprintf(buf, sizeof(buf), "[coproc] cuMemGetInfo(%d) returned %d", cc.device_num, retval ); warnings.push_back(buf); - (*__cuCtxDestroy)(ctx); + (*p_cuCtxDestroy)(ctx); return; } - (*__cuCtxDestroy)(ctx); + (*p_cuCtxDestroy)(ctx); cc.available_ram = (double) memfree; } @@ -602,11 +602,11 @@ static void get_available_nvidia_ram(COPROC_NVIDIA &cc, vector& warnings bool COPROC_NVIDIA::check_running_graphics_app() { int retval, j; bool change = false; - if (!__cuDeviceGet) { + if (!p_cuDeviceGet) { warnings.push_back("cuDeviceGet() missing from NVIDIA library"); return; } - if (!__cuDeviceGetAttribute) { + if (!p_cuDeviceGetAttribute) { warnings.push_back("cuDeviceGetAttribute() missing from NVIDIA library"); return; } @@ -614,9 +614,9 @@ bool COPROC_NVIDIA::check_running_graphics_app() { for (j=0; j