Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/controls.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,12 @@ The old name may still be used for backwards compatibility, but switching to the

If set to a nonzero value, the Intercept Layer for OpenCL Applications will break into the debugger when it is loaded.

### Tracing Controls

##### `BetaExtensionIntercepting` (bool)

If set to a nonzero value, the Intercept Layer for OpenCL Applications will intercept extension APIs for beta extensions that are subject to change. If an application uses beta extensions and does not function correctly with the Intercept Layer for OpenCL Applications, setting this control to zero may allow the application to function correctly, albeit without the ability to debug and analyze the beta extension APIs.

### Logging Controls

##### `SuppressLogging` (bool)
Expand Down
3 changes: 3 additions & 0 deletions intercept/src/controls.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
#define CLI_CONTROL_SEPARATOR( _name )
#endif

CLI_CONTROL_SEPARATOR( Tracing Controls: )
CLI_CONTROL( bool, BetaExtensionIntercepting, true, "If set to a nonzero value, the Intercept Layer for OpenCL Applications will intercept extension APIs for beta extensions that are subject to change. If an application uses beta extensions and does not function correctly with the Intercept Layer for OpenCL Applications, setting this control to zero may allow the application to function correctly, albeit without the ability to debug and analyze the beta extension APIs." )

CLI_CONTROL_SEPARATOR( Logging Controls: )
CLI_CONTROL( bool, SuppressLogging, false, "If set to a nonzero value, suppresses all logging output from the Intercept Layer for OpenCL Applications. This is particularly useful for tools that only want report data." )
CLI_CONTROL( bool, AppendFiles, false, "By default, the Intercept Layer for OpenCL Applications log files will be created from scratch when the intercept DLL is loaded, and any Intercept Layer for OpenCL Applications report files will be created from scratch when the intercept DLL is unloaded. If AppendFiles is set to a nonzero value, the Intercept Layer for OpenCL Applications will append to an existing file instead of recreating it. This can be useful if an application loads and unloads the intercept DLL multiple times, or to simply preserve log or report data from run-to-run." )
Expand Down
72 changes: 42 additions & 30 deletions intercept/src/intercept.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13658,31 +13658,40 @@ void* CLIntercept::getExtensionFunctionAddress(
CHECK_RETURN_EXTENSION_FUNCTION( clEnqueueReleaseDX9MediaSurfacesKHR );
#endif

// cl_khr_command_buffer
CHECK_RETURN_EXTENSION_FUNCTION( clCreateCommandBufferKHR );
CHECK_RETURN_EXTENSION_FUNCTION( clFinalizeCommandBufferKHR );
CHECK_RETURN_EXTENSION_FUNCTION( clRetainCommandBufferKHR );
CHECK_RETURN_EXTENSION_FUNCTION( clReleaseCommandBufferKHR );
CHECK_RETURN_EXTENSION_FUNCTION( clEnqueueCommandBufferKHR );
CHECK_RETURN_EXTENSION_FUNCTION( clCommandBarrierWithWaitListKHR );
CHECK_RETURN_EXTENSION_FUNCTION( clCommandCopyBufferKHR );
CHECK_RETURN_EXTENSION_FUNCTION( clCommandCopyBufferRectKHR );
CHECK_RETURN_EXTENSION_FUNCTION( clCommandCopyBufferToImageKHR );
CHECK_RETURN_EXTENSION_FUNCTION( clCommandCopyImageKHR );
CHECK_RETURN_EXTENSION_FUNCTION( clCommandCopyImageToBufferKHR );
CHECK_RETURN_EXTENSION_FUNCTION( clCommandFillBufferKHR );
CHECK_RETURN_EXTENSION_FUNCTION( clCommandFillImageKHR );
CHECK_RETURN_EXTENSION_FUNCTION( clCommandSVMMemcpyKHR );
CHECK_RETURN_EXTENSION_FUNCTION( clCommandSVMMemFillKHR );
CHECK_RETURN_EXTENSION_FUNCTION( clCommandNDRangeKernelKHR );
CHECK_RETURN_EXTENSION_FUNCTION( clGetCommandBufferInfoKHR );

// cl_khr_command_buffer_multi_device
CHECK_RETURN_EXTENSION_FUNCTION( clRemapCommandBufferKHR );

// cl_khr_command_buffer_mutable_dispatch
CHECK_RETURN_EXTENSION_FUNCTION( clUpdateMutableCommandsKHR );
CHECK_RETURN_EXTENSION_FUNCTION( clGetMutableCommandInfoKHR );
// cl_khr_command_buffer (beta)
if( config().BetaExtensionIntercepting )
{
CHECK_RETURN_EXTENSION_FUNCTION( clCreateCommandBufferKHR );
CHECK_RETURN_EXTENSION_FUNCTION( clFinalizeCommandBufferKHR );
CHECK_RETURN_EXTENSION_FUNCTION( clRetainCommandBufferKHR );
CHECK_RETURN_EXTENSION_FUNCTION( clReleaseCommandBufferKHR );
CHECK_RETURN_EXTENSION_FUNCTION( clEnqueueCommandBufferKHR );
CHECK_RETURN_EXTENSION_FUNCTION( clCommandBarrierWithWaitListKHR );
CHECK_RETURN_EXTENSION_FUNCTION( clCommandCopyBufferKHR );
CHECK_RETURN_EXTENSION_FUNCTION( clCommandCopyBufferRectKHR );
CHECK_RETURN_EXTENSION_FUNCTION( clCommandCopyBufferToImageKHR );
CHECK_RETURN_EXTENSION_FUNCTION( clCommandCopyImageKHR );
CHECK_RETURN_EXTENSION_FUNCTION( clCommandCopyImageToBufferKHR );
CHECK_RETURN_EXTENSION_FUNCTION( clCommandFillBufferKHR );
CHECK_RETURN_EXTENSION_FUNCTION( clCommandFillImageKHR );
CHECK_RETURN_EXTENSION_FUNCTION( clCommandSVMMemcpyKHR );
CHECK_RETURN_EXTENSION_FUNCTION( clCommandSVMMemFillKHR );
CHECK_RETURN_EXTENSION_FUNCTION( clCommandNDRangeKernelKHR );
CHECK_RETURN_EXTENSION_FUNCTION( clGetCommandBufferInfoKHR );
}

// cl_khr_command_buffer_multi_device (beta)
if( config().BetaExtensionIntercepting )
{
CHECK_RETURN_EXTENSION_FUNCTION( clRemapCommandBufferKHR );
}

// cl_khr_command_buffer_mutable_dispatch (beta)
if( config().BetaExtensionIntercepting )
{
CHECK_RETURN_EXTENSION_FUNCTION( clUpdateMutableCommandsKHR );
CHECK_RETURN_EXTENSION_FUNCTION( clGetMutableCommandInfoKHR );
}

// cl_khr_create_command_queue
CHECK_RETURN_EXTENSION_FUNCTION( clCreateCommandQueueWithPropertiesKHR );
Expand Down Expand Up @@ -13726,11 +13735,14 @@ void* CLIntercept::getExtensionFunctionAddress(
// cl_khr_suggested_local_work_size
CHECK_RETURN_EXTENSION_FUNCTION( clGetKernelSuggestedLocalWorkSizeKHR );

// cl_khr_unified_svm
CHECK_RETURN_EXTENSION_FUNCTION( clSVMAllocWithPropertiesKHR );
CHECK_RETURN_EXTENSION_FUNCTION( clSVMFreeWithPropertiesKHR );
CHECK_RETURN_EXTENSION_FUNCTION( clGetSVMPointerInfoKHR );
CHECK_RETURN_EXTENSION_FUNCTION( clGetSVMSuggestedTypeIndexKHR );
// cl_khr_unified_svm (beta)
if( config().BetaExtensionIntercepting )
{
CHECK_RETURN_EXTENSION_FUNCTION( clSVMAllocWithPropertiesKHR );
CHECK_RETURN_EXTENSION_FUNCTION( clSVMFreeWithPropertiesKHR );
CHECK_RETURN_EXTENSION_FUNCTION( clGetSVMPointerInfoKHR );
CHECK_RETURN_EXTENSION_FUNCTION( clGetSVMSuggestedTypeIndexKHR );
}

// cl_ext_buffer_device_address
CHECK_RETURN_EXTENSION_FUNCTION( clSetKernelArgDevicePointerEXT );
Expand Down