Skip to content

[SYCL][USM] fix clMemFreeIntel ptr argument #1860

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

hiaselhans
Copy link
Contributor

Compiling llvm from 0 (using cmake to download opencl headers) fails with the following message:

In file included from ~/dev/gpu/llvm/sycl/include/CL/sycl/detail/pi.h:49,
                 from ~/dev/gpu/llvm/sycl/include/CL/sycl/exception.hpp:15,
                 from ~/dev/gpu/llvm/sycl/include/CL/sycl/detail/common.hpp:121,
                 from ~/dev/gpu/llvm/sycl/include/CL/sycl/aliases.hpp:11,
                 from ~/dev/gpu/llvm/sycl/include/CL/sycl/detail/generic_type_traits.hpp:12,
                 from ~/dev/gpu/llvm/sycl/source/detail/builtins_helper.hpp:10,
                 from ~/dev/gpu/llvm/sycl/source/detail/builtins_common.cpp:18:
~/dev/gpu/llvm/sycl/include/CL/cl_usm_ext.h:125:21: error: conflicting declaration 'typedef cl_int (* clMemFreeINTEL_fn)(cl_context, const void*)'
  125 | cl_int(CL_API_CALL *clMemFreeINTEL_fn)(cl_context context,
      |                     ^~~~~~~~~~~~~~~~~
In file included from ~/dev/gpu/llvm/sycl/include/CL/sycl/detail/common.hpp:11,
                 from ~/dev/gpu/llvm/sycl/include/CL/sycl/aliases.hpp:11,
                 from ~/dev/gpu/llvm/sycl/include/CL/sycl/detail/generic_type_traits.hpp:12,
                 from ~/dev/gpu/llvm/sycl/source/detail/builtins_helper.hpp:10,
                 from ~/dev/gpu/llvm/sycl/source/detail/builtins_common.cpp:18:
tools/sycl/OpenCL/inc/CL/cl_ext_intel.h:533:1: note: previous declaration as 'typedef cl_int (* clMemFreeINTEL_fn)(cl_context, void*)'
  533 | clMemFreeINTEL_fn)(
      | ^~~~~~~~~~~~~~~~~

It seems to relate to a commit in OpenCL-Headers
where clMemFreeIntel is defined as void* instead of const void*:
https://github.com/KhronosGroup/OpenCL-Headers/blob/b04034a17e214322772c19e7ccd2adf0cd306920/CL/cl_ext_intel.h#L530

This PR changes the arguments from const void* -> void*
It is untested but compiles again.

const void* -> void*

Signed-off-by: hiaselhans <simon.klemenc@gmail.com>
@hiaselhans hiaselhans requested a review from jbrodman as a code owner June 10, 2020 08:58
@hiaselhans hiaselhans changed the title change clMemFreeIntel ptr argument [SYCL][USM] fix clMemFreeIntel ptr argument Jun 10, 2020
@bader
Copy link
Contributor

bader commented Jun 10, 2020

Thanks!
I think @againull addressed this problem in #1852.

@hiaselhans
Copy link
Contributor Author

oh!

perfect then! thanks for the fix :)

@hiaselhans hiaselhans closed this Jun 10, 2020
@hiaselhans hiaselhans deleted the clmemfree_intel branch June 11, 2020 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants