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

Function OneAPICPUOffload

src/backend/oneapi/platform.cpp:344–366  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

342}
343
344bool OneAPICPUOffload(bool forceOffloadOSX) {
345 static const bool offloadEnv = getEnvVar("AF_ONEAPI_CPU_OFFLOAD") != "0";
346 bool offload = false;
347 if (offloadEnv) { offload = isHostUnifiedMemory(getDevice()); }
348#if OS_MAC
349 // FORCED OFFLOAD FOR LAPACK FUNCTIONS ON OSX UNIFIED MEMORY DEVICES
350 //
351 // On OSX Unified Memory devices (Intel), always offload LAPACK but not GEMM
352 // irrespective of the AF_OPENCL_CPU_OFFLOAD value
353 // From GEMM, OpenCLCPUOffload(false) is called which will render the
354 // variable inconsequential to the returned result.
355 //
356 // Issue https://github.com/arrayfire/arrayfire/issues/662
357 //
358 // Make sure device has unified memory
359 bool osx_offload = isHostUnifiedMemory(getDevice());
360 // Force condition
361 offload = osx_offload && (offload || forceOffloadOSX);
362#else
363 UNUSED(forceOffloadOSX);
364#endif
365 return offload;
366}
367
368bool isGLSharingSupported() {
369 device_id_t& devId = tlocalActiveDeviceId();

Callers

nothing calls this directly

Calls 3

getEnvVarFunction · 0.85
isHostUnifiedMemoryFunction · 0.85
getDeviceFunction · 0.85

Tested by

no test coverage detected