MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / OpenCLCPUOffload

Function OpenCLCPUOffload

src/backend/opencl/platform.cpp:398–418  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

396}
397
398bool OpenCLCPUOffload(bool forceOffloadOSX) {
399 static const bool offloadEnv = getEnvVar("AF_OPENCL_CPU_OFFLOAD") != "0";
400 bool offload = false;
401 if (offloadEnv) { offload = getDeviceType() == CL_DEVICE_TYPE_CPU; }
402#if OS_MAC
403 // FORCED OFFLOAD FOR LAPACK FUNCTIONS ON OSX UNIFIED MEMORY DEVICES
404 //
405 // On OSX Unified Memory devices (Intel), always offload LAPACK but not GEMM
406 // irrespective of the AF_OPENCL_CPU_OFFLOAD value
407 // From GEMM, OpenCLCPUOffload(false) is called which will render the
408 // variable inconsequential to the returned result.
409 //
410 // Issue https://github.com/arrayfire/arrayfire/issues/662
411 // Force condition
412 bool osx_offload = getDeviceType() == CL_DEVICE_TYPE_CPU;
413 offload = osx_offload && (offload || forceOffloadOSX);
414#else
415 UNUSED(forceOffloadOSX);
416#endif
417 return offload;
418}
419
420bool isGLSharingSupported() {
421 device_id_t& devId = tlocalActiveDeviceId();

Callers 13

svdInPlaceFunction · 0.85
svdFunction · 0.85
luFunction · 0.85
lu_inplaceFunction · 0.85
cholesky_inplaceFunction · 0.85
choleskyFunction · 0.85
inverseFunction · 0.85
matmulFunction · 0.85
qrFunction · 0.85
qr_inplaceFunction · 0.85
gemmFunction · 0.85
solveLUFunction · 0.85

Calls 2

getEnvVarFunction · 0.85
getDeviceTypeFunction · 0.70

Tested by

no test coverage detected