Skip to content
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

Graph fixes + other stuff #434

Open
wants to merge 35 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
450c3e6
Update OpenCL headers in include/CL
franz Mar 30, 2023
8714c1e
opencl.hpp: make clGetDeviceInfo recognize Intel Subgroup Size
franz Apr 5, 2023
d34db90
add include/CL/cl_ext_pocl.h (required for command buffer extensions)
franz May 9, 2023
525f0a4
src/CHIPBindings.cc: add missing error-checking for Graph API
franz May 9, 2023
c4f654e
implement CHIPGraphNative
franz May 9, 2023
c36b530
cleanup/refactor OpenCL backend code
franz May 9, 2023
4aeedfa
add more error-checking & bugfixes
franz Apr 17, 2023
689cd1f
OpenCL backend: add support for cl_intel_unified_shared_memory
franz May 10, 2023
377f98d
src/CHIPBindings_spt.cc: add missing return from function
franz May 10, 2023
09df3c8
samples/hip-cuda: disable printfs on each kernel iteration
franz May 4, 2023
b7c0212
samples/hip-cuda: convert tests to report also Best iteration time
franz May 5, 2023
a6e2750
update unit tests with failing/passing Graph tests
franz May 10, 2023
10b2fa1
update test_lists again, move graphs to FAILING_FOR_ALL
franz May 11, 2023
781d7a9
fix a problem with UserEvents released too early
franz May 11, 2023
7264667
disable USM memory allocation types other than Shared
franz May 12, 2023
f298848
disable USM support by default, can be enabled with CMake option
franz May 14, 2023
a9f09e7
Update src/CHIPBackend.cc
franz May 17, 2023
7ee740f
Update src/CHIPBindings.cc
franz May 17, 2023
79edc52
Style fix src/CHIPGraph.cc
franz May 17, 2023
b840157
Style fix src/backend/OpenCL/CHIPBackendOpenCL.cc
franz May 17, 2023
ba74330
Style fix src/CHIPGraph.cc
franz May 17, 2023
0aec729
Style fix src/backend/OpenCL/CHIPBackendOpenCL.cc
franz May 17, 2023
e806f19
Style fix src/backend/OpenCL/CHIPBackendOpenCL.cc
franz May 17, 2023
2f9f86e
Style fix src/backend/OpenCL/SVMemoryRegion.cc
franz May 17, 2023
e6aa207
Avoid unnecessary copy in Kernel->getName()
franz May 17, 2023
fb5d7e2
add const to bool methods
franz May 17, 2023
29651da
Style fix src/backend/OpenCL/CHIPBackendOpenCL.cc
franz May 17, 2023
282a90c
Style fix src/backend/OpenCL/CHIPBackendOpenCL.cc
franz May 17, 2023
1e1fafc
Style fix src/CHIPGraph.cc
franz May 17, 2023
84ab96d
Style fix src/CHIPBindings.cc
franz May 17, 2023
d922f75
Style fix src/CHIPGraph.cc
franz May 17, 2023
79a6e38
Style fixes
franz May 17, 2023
d7a0e71
More fixes, remove unused code / comments
franz May 17, 2023
582d4ff
Rename getRegion -> getSVMRegion, rename private variables
franz May 17, 2023
0f4f3c8
Style fix src/CHIPGraph.hh
franz May 17, 2023
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
2 changes: 2 additions & 0 deletions CHIPSPVConfig.hh.in
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,6 @@

#cmakedefine CHIP_DEFAULT_WARP_SIZE @DEFAULT_WARP_SIZE@

#cmakedefine INTEL_USM_SUPPORT

#endif
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ option(USE_EXTERNAL_HIP_TESTS "Use Catch2 tests from the hip-tests submodule" OF
option(USE_OCML_ROUNDED_OPS "Use OCML implementations for devicelib functions with explicit rounding mode such as __dadd_rd. Otherwise, rounding mode will be ignored" OFF)
option(CHIP_ENABLE_NON_COMPLIANT_DEVICELIB_CODE "Enable non-compliant devicelib code such as calling LLVM builtins from inside kernel code. Enables certain unsigned long devicelib func variants" OFF)
option(CHIP_FAST_MATH "Use native_ OpenCL functions which are fast but their precision is implementation defined" OFF)

option(INTEL_USM_SUPPORT "enable support for cl_intel_unified_shared_memory in the OpenCL backend" OFF)
# Warpsize would optimally be a device-specific, queried and made
# effective at runtime. However, we need to fix the warpsize since SPIR-Vs need
# to be portable across multiple devices. It should be more portable to
Expand Down
686 changes: 70 additions & 616 deletions cmake/UnitTests.cmake

Large diffs are not rendered by default.

53 changes: 30 additions & 23 deletions include/CL/cl.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ typedef struct _cl_image_desc {
#pragma warning( push )
#pragma warning( disable : 4201 ) /* Prevents warning about nameless struct/union in /W4 builds */
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wc11-extensions" /* Prevents warning about nameless union being C11 extension*/
#endif
#if defined(_MSC_VER) && defined(__STDC__)
/* Anonymous unions are not supported in /Za builds */
#else
Expand All @@ -158,6 +162,9 @@ typedef struct _cl_image_desc {
#if defined(_MSC_VER) && !defined(__STDC__)
#pragma warning( pop )
#endif
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif
} cl_image_desc;

Expand Down Expand Up @@ -1311,11 +1318,11 @@ clLinkProgram(cl_context context,

#ifdef CL_VERSION_2_2

extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_2_2_DEPRECATED cl_int CL_API_CALL
extern CL_API_ENTRY CL_API_PREFIX__VERSION_2_2_DEPRECATED cl_int CL_API_CALL
clSetProgramReleaseCallback(cl_program program,
void (CL_CALLBACK * pfn_notify)(cl_program program,
void * user_data),
void * user_data) CL_EXT_SUFFIX__VERSION_2_2_DEPRECATED;
void * user_data) CL_API_SUFFIX__VERSION_2_2_DEPRECATED;

extern CL_API_ENTRY cl_int CL_API_CALL
clSetProgramSpecializationConstant(cl_program program,
Expand Down Expand Up @@ -1857,21 +1864,21 @@ clGetExtensionFunctionAddressForPlatform(cl_platform_id platform,
clSetCommandQueueProperty(cl_command_queue command_queue,
cl_command_queue_properties properties,
cl_bool enable,
cl_command_queue_properties * old_properties) CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED;
cl_command_queue_properties * old_properties) CL_API_SUFFIX__VERSION_1_0_DEPRECATED;
#endif /* CL_USE_DEPRECATED_OPENCL_1_0_APIS */

/* Deprecated OpenCL 1.1 APIs */
extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_mem CL_API_CALL
extern CL_API_ENTRY CL_API_PREFIX__VERSION_1_1_DEPRECATED cl_mem CL_API_CALL
clCreateImage2D(cl_context context,
cl_mem_flags flags,
const cl_image_format * image_format,
size_t image_width,
size_t image_height,
size_t image_row_pitch,
void * host_ptr,
cl_int * errcode_ret) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_1_DEPRECATED;

extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_mem CL_API_CALL
extern CL_API_ENTRY CL_API_PREFIX__VERSION_1_1_DEPRECATED cl_mem CL_API_CALL
clCreateImage3D(cl_context context,
cl_mem_flags flags,
const cl_image_format * image_format,
Expand All @@ -1881,46 +1888,46 @@ clCreateImage3D(cl_context context,
size_t image_row_pitch,
size_t image_slice_pitch,
void * host_ptr,
cl_int * errcode_ret) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_1_DEPRECATED;

extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_int CL_API_CALL
extern CL_API_ENTRY CL_API_PREFIX__VERSION_1_1_DEPRECATED cl_int CL_API_CALL
clEnqueueMarker(cl_command_queue command_queue,
cl_event * event) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
cl_event * event) CL_API_SUFFIX__VERSION_1_1_DEPRECATED;

extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_int CL_API_CALL
extern CL_API_ENTRY CL_API_PREFIX__VERSION_1_1_DEPRECATED cl_int CL_API_CALL
clEnqueueWaitForEvents(cl_command_queue command_queue,
cl_uint num_events,
const cl_event * event_list) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
const cl_event * event_list) CL_API_SUFFIX__VERSION_1_1_DEPRECATED;

extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_int CL_API_CALL
clEnqueueBarrier(cl_command_queue command_queue) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
extern CL_API_ENTRY CL_API_PREFIX__VERSION_1_1_DEPRECATED cl_int CL_API_CALL
clEnqueueBarrier(cl_command_queue command_queue) CL_API_SUFFIX__VERSION_1_1_DEPRECATED;

extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_int CL_API_CALL
clUnloadCompiler(void) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
extern CL_API_ENTRY CL_API_PREFIX__VERSION_1_1_DEPRECATED cl_int CL_API_CALL
clUnloadCompiler(void) CL_API_SUFFIX__VERSION_1_1_DEPRECATED;

extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED void * CL_API_CALL
clGetExtensionFunctionAddress(const char * func_name) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
extern CL_API_ENTRY CL_API_PREFIX__VERSION_1_1_DEPRECATED void * CL_API_CALL
clGetExtensionFunctionAddress(const char * func_name) CL_API_SUFFIX__VERSION_1_1_DEPRECATED;

/* Deprecated OpenCL 2.0 APIs */
extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_2_DEPRECATED cl_command_queue CL_API_CALL
extern CL_API_ENTRY CL_API_PREFIX__VERSION_1_2_DEPRECATED cl_command_queue CL_API_CALL
clCreateCommandQueue(cl_context context,
cl_device_id device,
cl_command_queue_properties properties,
cl_int * errcode_ret) CL_EXT_SUFFIX__VERSION_1_2_DEPRECATED;
cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_2_DEPRECATED;

extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_2_DEPRECATED cl_sampler CL_API_CALL
extern CL_API_ENTRY CL_API_PREFIX__VERSION_1_2_DEPRECATED cl_sampler CL_API_CALL
clCreateSampler(cl_context context,
cl_bool normalized_coords,
cl_addressing_mode addressing_mode,
cl_filter_mode filter_mode,
cl_int * errcode_ret) CL_EXT_SUFFIX__VERSION_1_2_DEPRECATED;
cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_2_DEPRECATED;

extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_2_DEPRECATED cl_int CL_API_CALL
extern CL_API_ENTRY CL_API_PREFIX__VERSION_1_2_DEPRECATED cl_int CL_API_CALL
clEnqueueTask(cl_command_queue command_queue,
cl_kernel kernel,
cl_uint num_events_in_wait_list,
const cl_event * event_wait_list,
cl_event * event) CL_EXT_SUFFIX__VERSION_1_2_DEPRECATED;
cl_event * event) CL_API_SUFFIX__VERSION_1_2_DEPRECATED;

#ifdef __cplusplus
}
Expand Down
Loading