@@ -41,142 +41,107 @@ <h1 class="title">Configuring Arrayfire Environment</h1>
4141< li > < a href ="#af_cuda_max_jit_len "> 15 AF_CUDA_MAX_JIT_LEN</ a > < ul > </ ul > </ li >
4242< li > < a href ="#af_cpu_max_jit_len "> 16 AF_CPU_MAX_JIT_LEN</ a > < ul > </ ul > </ li > </ ul > </ nav > < p > Following are the list of environment and runtime configurations that will help enhance
4343your experience with ArrayFire.</ p >
44-
45- < h1 id ='af_path ' class ='section-header '> < a href ='#af_path '> 1 AF_PATH</ a > </ h1 >
44+ < h1 id ="af_path " class ="section-header "> < a href ="#af_path "> 1 AF_PATH</ a > </ h1 >
4645< p > This is the path with ArrayFire gets installed, ie. the includes and libs are
4746present in this directory. You can use this variable to add include paths and
4847libraries to your projects.</ p >
49-
50- < h1 id ='af_print_errors ' class ='section-header '> < a href ='#af_print_errors '> 2 AF_PRINT_ERRORS</ a > </ h1 >
48+ < h1 id ="af_print_errors " class ="section-header "> < a href ="#af_print_errors "> 2 AF_PRINT_ERRORS</ a > </ h1 >
5149< p > When AF_PRINT_ERRORS is set to 1, the exceptions thrown are more verbose and
5250detailed. This helps in locating the exact failure.</ p >
5351
5452< pre class ="rust rust-example-rendered ">
5553< span class ="ident "> AF_PRINT_ERRORS</ span > < span class ="op "> =</ span > < span class ="number "> 1</ span > .< span class ="op "> /</ span > < span class ="ident "> myprogram</ span > </ pre >
56-
57- < h1 id ='af_cuda_default_device ' class ='section-header '> < a href ='#af_cuda_default_device '> 3 AF_CUDA_DEFAULT_DEVICE</ a > </ h1 >
54+ < h1 id ="af_cuda_default_device " class ="section-header "> < a href ="#af_cuda_default_device "> 3 AF_CUDA_DEFAULT_DEVICE</ a > </ h1 >
5855< p > Use this variable to set the default CUDA device. Valid values for this
5956variable are the device identifiers shown when < a href ="./fn.info.html "> af::info</ a > is run.</ p >
6057
6158< pre class ="rust rust-example-rendered ">
6259< span class ="ident "> AF_CUDA_DEFAULT_DEVICE</ span > < span class ="op "> =</ span > < span class ="number "> 1</ span > .< span class ="op "> /</ span > < span class ="ident "> myprogram</ span > </ pre >
63-
6460< p > Note: af::setDevice call in the source code will take precedence over this
6561variable.</ p >
66-
67- < h1 id ='af_opencl_default_device ' class ='section-header '> < a href ='#af_opencl_default_device '> 4 AF_OPENCL_DEFAULT_DEVICE</ a > </ h1 >
62+ < h1 id ="af_opencl_default_device " class ="section-header "> < a href ="#af_opencl_default_device "> 4 AF_OPENCL_DEFAULT_DEVICE</ a > </ h1 >
6863< p > Use this variable to set the default OpenCL device. Valid values for this
6964variable are the device identifiers shown when < a href ="./fn.info.html "> af::info</ a > is run.</ p >
7065
7166< pre class ="rust rust-example-rendered ">
7267< span class ="ident "> AF_OPENCL_DEFAULT_DEVICE</ span > < span class ="op "> =</ span > < span class ="number "> 1</ span > .< span class ="op "> /</ span > < span class ="ident "> myprogram</ span > </ pre >
73-
7468< p > Note: < a href ="./fn.set_device.html "> af::set_device</ a > call in the source code will take precedence over this
7569variable.</ p >
76-
77- < h1 id ='af_opencl_default_device_type ' class ='section-header '> < a href ='#af_opencl_default_device_type '> 5 AF_OPENCL_DEFAULT_DEVICE_TYPE</ a > </ h1 >
70+ < h1 id ="af_opencl_default_device_type " class ="section-header "> < a href ="#af_opencl_default_device_type "> 5 AF_OPENCL_DEFAULT_DEVICE_TYPE</ a > </ h1 >
7871< p > Use this variable to set the default OpenCL device type. Valid values for this
7972variable are: CPU, GPU, ACC (Accelerators).</ p >
80-
8173< p > When set, the first device of the specified type is chosen as default device.</ p >
8274
8375< pre class ="rust rust-example-rendered ">
8476< span class ="ident "> AF_OPENCL_DEFAULT_DEVICE_TYPE</ span > < span class ="op "> =</ span > < span class ="ident "> CPU</ span > .< span class ="op "> /</ span > < span class ="ident "> myprogram</ span > </ pre >
85-
8677< p > Note: < code > AF_OPENCL_DEFAULT_DEVICE</ code > and < a href ="./fn.set_device.html "> af::set_device</ a > takes precedence over this variable.</ p >
87-
88- < h1 id ='af_opencl_device_type ' class ='section-header '> < a href ='#af_opencl_device_type '> 6 AF_OPENCL_DEVICE_TYPE</ a > </ h1 >
78+ < h1 id ="af_opencl_device_type " class ="section-header "> < a href ="#af_opencl_device_type "> 6 AF_OPENCL_DEVICE_TYPE</ a > </ h1 >
8979< p > Use this variable to only choose OpenCL devices of specified type. Valid values for this
9080variable are:</ p >
91-
9281< ul >
9382< li > ALL: All OpenCL devices. (Default behavior).</ li >
9483< li > CPU: CPU devices only.</ li >
9584< li > GPU: GPU devices only.</ li >
9685< li > ACC: Accelerator devices only.</ li >
9786</ ul >
98-
9987< p > When set, the remaining OpenCL device types are ignored by the OpenCL backend.</ p >
10088
10189< pre class ="rust rust-example-rendered ">
10290< span class ="ident "> AF_OPENCL_DEVICE_TYPE</ span > < span class ="op "> =</ span > < span class ="ident "> CPU</ span > .< span class ="op "> /</ span > < span class ="ident "> myprogram</ span > </ pre >
103-
104- < h1 id ='af_opencl_cpu_offload ' class ='section-header '> < a href ='#af_opencl_cpu_offload '> 7 AF_OPENCL_CPU_OFFLOAD</ a > </ h1 >
91+ < h1 id ="af_opencl_cpu_offload " class ="section-header "> < a href ="#af_opencl_cpu_offload "> 7 AF_OPENCL_CPU_OFFLOAD</ a > </ h1 >
10592< p > When ArrayFire runs on devices with unified memory with the host (ie.
10693< code > CL_DEVICE_HOST_UNIFIED_MENORY</ code > is true for the device) then certain functions
10794are offloaded to run on the CPU using mapped buffers.</ p >
108-
10995< p > ArrayFire takes advantage of fast libraries such as MKL while spending no time
11096copying memory from device to host. The device memory is mapped to a host
11197pointer which can be used in the offloaded functions.</ p >
112-
11398< p > This functionality can be disabled by using the environment variable
11499< code > AF_OPENCL_CPU_OFFLOAD=0</ code > .</ p >
115-
116100< p > The default bevaior of this has changed in version 3.4.</ p >
117-
118101< p > Prior to v3.4, CPU Offload functionality was used only when the user set
119102< code > AF_OPENCL_CPU_OFFLOAD=1</ code > and disabled otherwise.</ p >
120-
121103< p > From v3.4 onwards, CPU Offload is enabled by default and is disabled only when
122104< code > AF_OPENCL_CPU_OFFLOAD=0</ code > is set.</ p >
123-
124- < h1 id ='af_opencl_show_build_info ' class ='section-header '> < a href ='#af_opencl_show_build_info '> 8 AF_OPENCL_SHOW_BUILD_INFO</ a > </ h1 >
105+ < h1 id ="af_opencl_show_build_info " class ="section-header "> < a href ="#af_opencl_show_build_info "> 8 AF_OPENCL_SHOW_BUILD_INFO</ a > </ h1 >
125106< p > This variable is useful when debuggin OpenCL kernel compilation failures. When
126107this variable is set to 1, and an error occurs during a OpenCL kernel
127108compilation, then the log and kernel are printed to screen.</ p >
128-
129- < h1 id ='af_disable_graphics ' class ='section-header '> < a href ='#af_disable_graphics '> 9 AF_DISABLE_GRAPHICS</ a > </ h1 >
109+ < h1 id ="af_disable_graphics " class ="section-header "> < a href ="#af_disable_graphics "> 9 AF_DISABLE_GRAPHICS</ a > </ h1 >
130110< p > Setting this variable to 1 will disable window creation when graphics
131111functions are being called. Disabling window creation will disable all other
132112graphics calls at runtime as well.</ p >
133-
134113< p > This is a useful enviornment variable when running code on servers and systems
135114without displays. When graphics calls are run on such machines, they will
136115print warning about window creation failing. To suppress those calls, set this
137116variable.</ p >
138-
139- < h1 id ='af_synchronous_calls ' class ='section-header '> < a href ='#af_synchronous_calls '> 10 AF_SYNCHRONOUS_CALLS</ a > </ h1 >
117+ < h1 id ="af_synchronous_calls " class ="section-header "> < a href ="#af_synchronous_calls "> 10 AF_SYNCHRONOUS_CALLS</ a > </ h1 >
140118< p > When this environment variable is set to 1, ArrayFire will execute all
141119functions synchronously.</ p >
142-
143- < h1 id ='af_show_load_path ' class ='section-header '> < a href ='#af_show_load_path '> 11 AF_SHOW_LOAD_PATH</ a > </ h1 >
120+ < h1 id ="af_show_load_path " class ="section-header "> < a href ="#af_show_load_path "> 11 AF_SHOW_LOAD_PATH</ a > </ h1 >
144121< p > When using the Unified backend, if this variable is set to 1, it will show the
145122path where the ArrayFire backend libraries are loaded from.</ p >
146-
147123< p > If the libraries are loaded from system paths, such as PATH or LD_LIBRARY_PATH
148124etc, then it will print "system path". If the libraries are loaded from other
149125paths, then those paths are shown in full.</ p >
150-
151- < h1 id ='af_mem_debug ' class ='section-header '> < a href ='#af_mem_debug '> 12 AF_MEM_DEBUG</ a > </ h1 >
126+ < h1 id ="af_mem_debug " class ="section-header "> < a href ="#af_mem_debug "> 12 AF_MEM_DEBUG</ a > </ h1 >
152127< p > When AF_MEM_DEBUG is set to 1 (or anything not equal to 0), the caching mechanism in the memory manager is disabled.
153128The device buffers are allocated using native functions as needed and freed when going out of scope.</ p >
154-
155129< p > When the environment variable is not set, it is treated to be non zero.</ p >
156130
157131< pre class ="rust rust-example-rendered ">
158132< span class ="ident "> AF_MEM_DEBUG</ span > < span class ="op "> =</ span > < span class ="number "> 1</ span > .< span class ="op "> /</ span > < span class ="ident "> myprogram</ span > </ pre >
159-
160- < h1 id ='af_max_buffers ' class ='section-header '> < a href ='#af_max_buffers '> 13 AF_MAX_BUFFERS</ a > </ h1 >
133+ < h1 id ="af_max_buffers " class ="section-header "> < a href ="#af_max_buffers "> 13 AF_MAX_BUFFERS</ a > </ h1 >
161134< p > When AF_MAX_BUFFERS is set, this environment variable specifies the maximum number of buffers allocated before garbage collection kicks in.</ p >
162-
163135< p > 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.</ p >
164-
165136< p > When not set, the default value is 1000.</ p >
166-
167- < h1 id ='af_opencl_max_jit_len ' class ='section-header '> < a href ='#af_opencl_max_jit_len '> 14 AF_OPENCL_MAX_JIT_LEN</ a > </ h1 >
137+ < h1 id ="af_opencl_max_jit_len " class ="section-header "> < a href ="#af_opencl_max_jit_len "> 14 AF_OPENCL_MAX_JIT_LEN</ a > </ h1 >
168138< p > When set, this environment variable specifies the maximum height of the OpenCL JIT tree after which evaluation is forced.</ p >
169-
170139< p > The default value, as of v3.4, is 50 on OSX, 100 everywhere else. This value was 20 for older versions.</ p >
171-
172- < h1 id ='af_cuda_max_jit_len ' class ='section-header '> < a href ='#af_cuda_max_jit_len '> 15 AF_CUDA_MAX_JIT_LEN</ a > </ h1 >
140+ < h1 id ="af_cuda_max_jit_len " class ="section-header "> < a href ="#af_cuda_max_jit_len "> 15 AF_CUDA_MAX_JIT_LEN</ a > </ h1 >
173141< p > When set, this environment variable specifies the maximum height of the CUDA JIT tree after which evaluation is forced.</ p >
174-
175142< p > The default value, as of v3.4, 100. This value was 20 for older versions.</ p >
176-
177- < h1 id ='af_cpu_max_jit_len ' class ='section-header '> < a href ='#af_cpu_max_jit_len '> 16 AF_CPU_MAX_JIT_LEN</ a > </ h1 >
143+ < h1 id ="af_cpu_max_jit_len " class ="section-header "> < a href ="#af_cpu_max_jit_len "> 16 AF_CPU_MAX_JIT_LEN</ a > </ h1 >
178144< p > When set, this environment variable specifies the maximum length of the CPU JIT tree after which evaluation is forced.</ p >
179-
180145< p > The default value, as of v3.4, 100. This value was 20 for older versions.</ p >
181146
182147
0 commit comments