You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the struct CommandNDRangeKernelKernelWithDifferentContext, the method CreateKernelWithDifferentContext() uses a helper function, create_single_kernel_helper_create_program(), which calls another helper. Every helper takes a cl_program * as an argument, but the program variable being used is actually a clProgramWrapper.
I think this is the cause of the memory leak. Indeed replacing the call to create_single_kernel_helper_create_program() with a direct call to clCreateProgramWithSource() solves the issue.
Changing the helpers to accept wrapper arguments is more than a trivial change because this will eventually require kernelHelpers.h to include typeWrappers.h but that causes cyclic inclusion with the headers as they currently are.
The relevant method in the wrapper class acknowledges it is not ideal to be doing things this way:
// Ideally this function should not exist as it breaks encapsulation by
// allowing external mutation of the Wrapper internal state. However, too
// much code currently relies on this. For example, instead of using T* as
// output parameters, existing code can be updated to use Wrapper& instead.
T *operator&() { return &object; }
The text was updated successfully, but these errors were encountered:
In the struct
CommandNDRangeKernelKernelWithDifferentContext
, the methodCreateKernelWithDifferentContext()
uses a helper function,create_single_kernel_helper_create_program()
, which calls another helper. Every helper takes acl_program *
as an argument, but theprogram
variable being used is actually aclProgramWrapper
.I think this is the cause of the memory leak. Indeed replacing the call to
create_single_kernel_helper_create_program()
with a direct call toclCreateProgramWithSource()
solves the issue.Changing the helpers to accept wrapper arguments is more than a trivial change because this will eventually require
kernelHelpers.h
to includetypeWrappers.h
but that causes cyclic inclusion with the headers as they currently are.The relevant method in the
wrapper
class acknowledges it is not ideal to be doing things this way:The text was updated successfully, but these errors were encountered: