Skip to content

Commit 25557bb

Browse files
authored
add control to relax allocation limits (#197)
* added USM alloc property overrides * add build options for relaxed allocation limits * added compile and link options for relaxed allocation limits * regenerated controls doc * use CL_MEM_FLAGS instead of unreserved CL_MEM_FLAGS_INTEL
1 parent a5dd097 commit 25557bb

File tree

5 files changed

+529
-276
lines changed

5 files changed

+529
-276
lines changed

docs/controls.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ If set to a nonzero value, the Intercept Layer for OpenCL Applications will gene
353353

354354
##### `ChromePerformanceTimingInStages` (bool)
355355

356-
If set to a nonzero value, the Intercept Layer for OpenCL Applications will separate the performance infomation placed in the JSON file into Queued, Submitted, and Execution stages. It will also reorder the threads/queues by starting runtime. This flag is only functional when ChromePerformanceTiming is also set.
356+
If set to a nonzero value, the Intercept Layer for OpenCL Applications will separate the performance information placed in the JSON file into Queued, Submitted, and Execution stages. It will also reorder the threads/queues by starting runtime. This flag is only functional when ChromePerformanceTiming is also set.
357357

358358
##### `ChromePerformanceTimingPerKernel` (bool)
359359

@@ -411,7 +411,11 @@ If set to a nonzero value, the Intercept Layer for OpenCL Applications will look
411411

412412
##### `AppendBuildOptions` (string)
413413

414-
If set, the Intercept Layer for OpenCL Applications will add these build options to the end of any application provided or injected build options for each call to clBuildProgram().
414+
If set, the Intercept Layer for OpenCL Applications will add these build options to the end of any application provided or injected build options for each call to clCompileProgram or clBuildProgram().
415+
416+
##### `AppendLinkOptions` (string)
417+
418+
If set, the Intercept Layer for OpenCL Applications will add these build options to the end of any application provided or injected build options for each call to clLinkProgram().
415419

416420
##### `DumpProgramBuildLogs` (bool)
417421

@@ -653,6 +657,10 @@ If set to a nonzero value, and if no other priority hint is specified by the app
653657

654658
If set to a nonzero value, and if no other throttle hint is specified by the application, the Intercept Layer for OpencL Applications will attempt to create a command queue with this throttle hint value. Note: HIGH throttle is 1, MED throttle is 2, and LOW throttle is 4.
655659

660+
##### `RelaxAllocationLimits` (bool)
661+
662+
If set to a nonzero value, the Intercept Layer for OpenCL Applications will attempt to relax allocation limits to enable allocations larger than CL\_DEVICE\_MAX\_MEM\_ALLOC\_SIZE.
663+
656664
### Platform and Device Query Overrides
657665

658666
##### `PlatformName` (string)

intercept/src/controls.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ CLI_CONTROL( bool, InjectProgramBinaries, false, "If s
104104
CLI_CONTROL( bool, RejectProgramBinaries, false, "If set to a nonzero value, the Intercept Layer for OpenCL Applications will reject kernel binaries passed via clCreateProgramWithBinary() and return CL_INVALID_BINARY. This can be used to force an application to re-compile program binaries from source." )
105105
CLI_CONTROL( bool, InjectProgramSPIRV, false, "If set to a nonzero value, the Intercept Layer for OpenCL Applications will look to inject potentially modified kernel SPIR-V binaries via clCreateProgramWithIL() in place of program text for each call to clCreateProgramWithSource()." )
106106
CLI_CONTROL( bool, PrependProgramSource, false, "If set to a nonzero value, the Intercept Layer for OpenCL Applications will look to prepend kernel code from a file to the application provided kernel source passed to clCreateProgramWithSource(). The Intercept Layer for OpenCL Applications will look for kernel source to prepend in the dump and log directory. The files that are searched for are (in order) \"CLI_<Program Number>_<Unique Program Hash Code>_prepend.cl\", \"CLI_<Unique Program Hash Code>_prepend.cl\", and \"CLI_prepend.cl\"." )
107-
CLI_CONTROL( std::string, AppendBuildOptions, "", "If set, the Intercept Layer for OpenCL Applications will add these build options to the end of any application provided or injected build options for each call to clBuildProgram()." )
107+
CLI_CONTROL( std::string, AppendBuildOptions, "", "If set, the Intercept Layer for OpenCL Applications will add these build options to the end of any application provided or injected build options for each call to clCompileProgram or clBuildProgram()." )
108+
CLI_CONTROL( std::string, AppendLinkOptions, "", "If set, the Intercept Layer for OpenCL Applications will add these build options to the end of any application provided or injected build options for each call to clLinkProgram()." )
108109
CLI_CONTROL( bool, DumpProgramBuildLogs, false, "If set to a nonzero value, the Intercept Layer for OpenCL Applications will dump build logs for every device a program is built for to a separate file. The filename will have the form \"CLI_<Program Number>_<Unique Program Hash Code>_<Compile Count>_<Unique Build Options Hash Code>_<Device Type>_build_log.txt\"." )
109110
CLI_CONTROL( bool, DumpKernelISABinaries, false, "If set to a nonzero value, the Intercept Layer for OpenCL Applications will dump kernel ISA binaries for every kernel, if supported. Currently, kernel ISA binaries are only supported for Intel GPU devices. Kernel ISA binaries can be decoded into ISA text with a disassembler. The filename will have the form \"CLI_<Program Number>_<Unique Program Hash Code>_<Compile Count>_<Unique Build Options Hash Code>_<Device Type>_<Kernel Name>.isabin\"." )
110111

@@ -174,6 +175,7 @@ CLI_CONTROL( size_t, NullLocalWorkSizeZ, 0, "If s
174175
CLI_CONTROL( bool, InitializeBuffers, false, "If set to a nonzero value, the Intercept Layer for OpenCL Applications will initialize the contents of allocated buffers with zero. Only valid for non-COPY_HOST_PTR and non-USE_HOST_PTR allocations." )
175176
CLI_CONTROL( cl_uint, DefaultQueuePriorityHint, 0, "If set to a nonzero value, and if no other priority hint is specified by the application, the Intercept Layer for OpencL Applications will attempt to create a command queue with this priority hint value. Note: HIGH priority is 1, MED priority is 2, and LOW priority is 4." )
176177
CLI_CONTROL( cl_uint, DefaultQueueThrottleHint, 0, "If set to a nonzero value, and if no other throttle hint is specified by the application, the Intercept Layer for OpencL Applications will attempt to create a command queue with this throttle hint value. Note: HIGH throttle is 1, MED throttle is 2, and LOW throttle is 4." )
178+
CLI_CONTROL( bool, RelaxAllocationLimits, false, "If set to a nonzero value, the Intercept Layer for OpenCL Applications will attempt to relax allocation limits to enable allocations larger than CL_DEVICE_MAX_MEM_ALLOC_SIZE." )
177179

178180
CLI_CONTROL_SEPARATOR( Platform and Device Query Overrides: )
179181
CLI_CONTROL( std::string, PlatformName, "", "If set to a non-empty value, the clGetPlatformInfo() query for CL_PLATFORM_NAME will return this string instead of the true platform name." )

0 commit comments

Comments
 (0)