|
This page lists environment and runtime configurations that will help enhance your experience with ArrayFire.
The following are useful environment variable that can be used with ArrayFire.
This is the path with ArrayFire gets installed, ie. the includes and libs are present in this directory. You can use this variable to add include paths and libraries to your projects.
When AF_PRINT_ERRORS is set to 1, the exceptions thrown are more verbose and detailed. This helps in locating the exact failure.
Use this variable to set the default CUDA device. Valid values for this variable are the device identifiers shown when af::info is run.
Note: af::setDevice call in the source code will take precedence over this variable.
Use this variable to set the default OpenCL device. Valid values for this variable are the device identifiers shown when af::info is run.
Note: af::setDevice call in the source code will take precedence over this variable.
Use this variable to set the default OpenCL device type. Valid values for this variable are: CPU, GPU, ACC (Accelerators).
When set, the first device of the specified type is chosen as default device.
Note: AF_OPENCL_DEFAULT_DEVICE
and af::setDevice takes precedence over this variable.
Use this variable to only choose OpenCL devices of specified type. Valid values for this variable are:
When set, the remaining OpenCL device types are ignored by the OpenCL backend.
When this variable is set to 1, and the selected OpenCL device has unified memory with the host (ie. CL_DEVICE_HOST_UNIFIED_MEMORY
is true for device), then certain functions are offloaded to run on the CPU using mapped buffers.
This takes advantage of fast libraries such as MKL while spending no time copying memory from device to host. The device memory is mapped to a host pointer which can be used in the offloaded functions.
This variable is useful when debuggin OpenCL kernel compilation failures. When this variable is set to 1, and an error occurs during a OpenCL kernel compilation, then the log and kernel are printed to screen.
Setting this variable to 1 will disable window creation when graphics functions are being called. Disabling window creation will disable all other graphics calls at runtime as well.
This is a useful enviornment variable when running code on servers and systems without displays. When graphics calls are run on such machines, they will print warning about window creation failing. To suppress those calls, set this variable.
When this environment variable is set to 1, ArrayFire will execute all functions synchronously.
When using the Unified backend, if this variable is set to 1, it will show the path where the ArrayFire backend libraries are loaded from.
If the libraries are loaded from system paths, such as PATH or LD_LIBRARY_PATH etc, then it will print "system path". If the libraries are loaded from other paths, then those paths are shown in full.
When AF_MEM_DEBUG is set to 1 (or anything not equal to 0), the caching mechanism in the memory manager. The device buffers are allocated using native functions as needed and freed when going out of scope.
When the environment variable is not set, it is treated to be non zero.
When AF_MAX_BUFFERS is set, this environment variable specifies the maximum number of buffers allocated before garbage collection kicks in.
Please note that the total number of buffers that can exist simultaneously can be higher than this number. This variable tells the garbage collector that it should free any available buffers immediately if the treshold is reached.
When not set, the default value is 1000.
When set, this environment variable specifies the maximum length of the OpenCL JIT tree after which evaluation is forced. The default value for this is 16 for AMD devices and 20 otherwise.
When set, this environment variable specifies the maximum length of the CUDA JIT tree after which evaluation is forced. The default value for this is 20.
When set, this environment variable specifies the maximum length of the CPU JIT tree after which evaluation is forced. The default value for this is 20.