From 246e12f5709f9f429f6188a2850d2b594be68a6f Mon Sep 17 00:00:00 2001 From: Ben Ashbaugh Date: Mon, 16 Feb 2026 17:34:15 -0800 Subject: [PATCH 1/3] add a control to skip tracing beta extensions --- docs/controls.md | 6 ++++ intercept/src/controls.h | 3 ++ intercept/src/intercept.cpp | 72 +++++++++++++++++++++---------------- 3 files changed, 51 insertions(+), 30 deletions(-) diff --git a/docs/controls.md b/docs/controls.md index 51e159f0..1ea2962c 100644 --- a/docs/controls.md +++ b/docs/controls.md @@ -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 + +##### `BetaExtensionTracing` (bool) + +If set to a nonzero value, the Intercept Layer for OpenCL Applications will trace extensions that are beta extensions and 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 tracing the beta extensions. + ### Logging Controls ##### `SuppressLogging` (bool) diff --git a/intercept/src/controls.h b/intercept/src/controls.h index d4033189..e2982e03 100644 --- a/intercept/src/controls.h +++ b/intercept/src/controls.h @@ -12,6 +12,9 @@ #define CLI_CONTROL_SEPARATOR( _name ) #endif +CLI_CONTROL_SEPARATOR( Tracing Controls: ) +CLI_CONTROL( bool, BetaExtensionTracing, true, "If set to a nonzero value, the Intercept Layer for OpenCL Applications will trace extensions that are beta extensions and 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 tracing the beta extensions." ) + 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." ) diff --git a/intercept/src/intercept.cpp b/intercept/src/intercept.cpp index 6af66c33..fadd366a 100644 --- a/intercept/src/intercept.cpp +++ b/intercept/src/intercept.cpp @@ -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().BetaExtensionTracing ) + { + 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().BetaExtensionTracing ) + { + CHECK_RETURN_EXTENSION_FUNCTION( clRemapCommandBufferKHR ); + } + + // cl_khr_command_buffer_mutable_dispatch (beta) + if( config().BetaExtensionTracing ) + { + CHECK_RETURN_EXTENSION_FUNCTION( clUpdateMutableCommandsKHR ); + CHECK_RETURN_EXTENSION_FUNCTION( clGetMutableCommandInfoKHR ); + } // cl_khr_create_command_queue CHECK_RETURN_EXTENSION_FUNCTION( clCreateCommandQueueWithPropertiesKHR ); @@ -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().BetaExtensionTracing ) + { + 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 ); From 3858c32e636b1bad72afddbe7b37bc6286fe37d1 Mon Sep 17 00:00:00 2001 From: Ben Ashbaugh Date: Wed, 18 Feb 2026 17:43:41 -0800 Subject: [PATCH 2/3] rename tracing to intercepting --- docs/controls.md | 4 ++-- intercept/src/controls.h | 2 +- intercept/src/intercept.cpp | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/controls.md b/docs/controls.md index 1ea2962c..5708b97d 100644 --- a/docs/controls.md +++ b/docs/controls.md @@ -131,9 +131,9 @@ If set to a nonzero value, the Intercept Layer for OpenCL Applications will brea ### Tracing Controls -##### `BetaExtensionTracing` (bool) +##### `BetaExtensionIntercepting` (bool) -If set to a nonzero value, the Intercept Layer for OpenCL Applications will trace extensions that are beta extensions and 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 tracing the beta extensions. +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 tracing the beta extension APIs. ### Logging Controls diff --git a/intercept/src/controls.h b/intercept/src/controls.h index e2982e03..7a45489f 100644 --- a/intercept/src/controls.h +++ b/intercept/src/controls.h @@ -13,7 +13,7 @@ #endif CLI_CONTROL_SEPARATOR( Tracing Controls: ) -CLI_CONTROL( bool, BetaExtensionTracing, true, "If set to a nonzero value, the Intercept Layer for OpenCL Applications will trace extensions that are beta extensions and 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 tracing the beta extensions." ) +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 tracing 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." ) diff --git a/intercept/src/intercept.cpp b/intercept/src/intercept.cpp index fadd366a..2421ad23 100644 --- a/intercept/src/intercept.cpp +++ b/intercept/src/intercept.cpp @@ -13659,7 +13659,7 @@ void* CLIntercept::getExtensionFunctionAddress( #endif // cl_khr_command_buffer (beta) - if( config().BetaExtensionTracing ) + if( config().BetaExtensionIntercepting ) { CHECK_RETURN_EXTENSION_FUNCTION( clCreateCommandBufferKHR ); CHECK_RETURN_EXTENSION_FUNCTION( clFinalizeCommandBufferKHR ); @@ -13681,13 +13681,13 @@ void* CLIntercept::getExtensionFunctionAddress( } // cl_khr_command_buffer_multi_device (beta) - if( config().BetaExtensionTracing ) + if( config().BetaExtensionIntercepting ) { CHECK_RETURN_EXTENSION_FUNCTION( clRemapCommandBufferKHR ); } // cl_khr_command_buffer_mutable_dispatch (beta) - if( config().BetaExtensionTracing ) + if( config().BetaExtensionIntercepting ) { CHECK_RETURN_EXTENSION_FUNCTION( clUpdateMutableCommandsKHR ); CHECK_RETURN_EXTENSION_FUNCTION( clGetMutableCommandInfoKHR ); @@ -13736,7 +13736,7 @@ void* CLIntercept::getExtensionFunctionAddress( CHECK_RETURN_EXTENSION_FUNCTION( clGetKernelSuggestedLocalWorkSizeKHR ); // cl_khr_unified_svm (beta) - if( config().BetaExtensionTracing ) + if( config().BetaExtensionIntercepting ) { CHECK_RETURN_EXTENSION_FUNCTION( clSVMAllocWithPropertiesKHR ); CHECK_RETURN_EXTENSION_FUNCTION( clSVMFreeWithPropertiesKHR ); From 5ac4f9a67e7166318b3982cb8473263c09857557 Mon Sep 17 00:00:00 2001 From: Ben Ashbaugh Date: Thu, 19 Feb 2026 08:59:34 -0800 Subject: [PATCH 3/3] minor fix to the control description --- docs/controls.md | 2 +- intercept/src/controls.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/controls.md b/docs/controls.md index 5708b97d..94011c42 100644 --- a/docs/controls.md +++ b/docs/controls.md @@ -133,7 +133,7 @@ If set to a nonzero value, the Intercept Layer for OpenCL Applications will brea ##### `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 tracing the beta extension APIs. +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 diff --git a/intercept/src/controls.h b/intercept/src/controls.h index 7a45489f..4115d176 100644 --- a/intercept/src/controls.h +++ b/intercept/src/controls.h @@ -13,7 +13,7 @@ #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 tracing the beta extension APIs." ) +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." )