| 342 | } |
| 343 | |
| 344 | bool 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 | |
| 368 | bool isGLSharingSupported() { |
| 369 | device_id_t& devId = tlocalActiveDeviceId(); |
nothing calls this directly
no test coverage detected