ROCm / ROCclr

42 stars 40 forks source link

Fix OpenCL headers 2021.04.29 compatibility #25

Open devurandom opened 3 years ago

devurandom commented 3 years ago

OpenCL headers 2021.04.29 moved CL_COMMAND_GL_FENCE_SYNC_OBJECT_KHR into a different header. (See issue referenced below for details.)

See-also: https://github.com/KhronosGroup/OpenCL-Headers/issues/145 See-also: https://bugs.gentoo.org/790164

devurandom commented 3 years ago

To build hip 4.3.0 I also needed to patch that:

rm amdocl/CL/cl{,_icd,_gl,_gl_ext,_platform}.h
sed -i 's/CL_EXT_SUFFIX/CL_API_SUFFIX/' \
  amdocl/CL/cl_icd_amd.h \
  amdocl/CL/cl_ext.h \
  rocclr/cl_lqdflash_amd.h

Since AMD's OpenCL extension headers (hip 4.3.0 needs some cl_amd_... symbols that it carries in amdocl/CL/cl_ext.h, but that are not in https://github.com/KhronosGroup/OpenCL-Headers) have been moved somewhere else (where? I was unable to find them) I would like some advice how to proceed here.

vsytch commented 3 years ago

The AMD OpenCL runtime unfortunately cannot work with the upstream OpenCL headers. There's a lot of issues currently blocking us from upgrading. Due to this, we cannot be making any fixes to accommodate any upstream changes as of right now.

Did you experience any build issues? The upstream OpenCL headers should not need to be involved in that.

devurandom commented 3 years ago

The AMD OpenCL runtime unfortunately cannot work with the upstream OpenCL headers. There's a lot of issues currently blocking us from upgrading. Due to this, we cannot be making any fixes to accommodate any upstream changes as of right now.

Did you experience any build issues? The upstream OpenCL headers should not need to be involved in that.

Yes, Gentoo users reported /usr/include/rocclr/platform/command.hpp:327:41: error: ‘CL_COMMAND_GL_FENCE_SYNC_OBJECT_KHR’ was not declared in this scope. That symbol comes from newer OpenCL headers.

See-also: https://bugs.gentoo.org/790164 Ebuild: https://gitweb.gentoo.org/repo/gentoo.git/tree/dev-util/hip/hip-4.3.0.ebuild

@vsytch There seems to be some restructuring of OpenCL headers going on in the AMD repos. Could you please tell me where to find the latest version? Maybe it is easier to work with that...