From 4a8c4322e976529a0ffe86e628a32dfc6969f048 Mon Sep 17 00:00:00 2001 From: againull <48139823+againull@users.noreply.github.com> Date: Wed, 10 Jun 2020 02:49:48 -0700 Subject: [PATCH] [SYCL] Fix broken build after introduction USM to ocl headers (#1852) Signed-off-by: Artur Gainullin --- sycl/include/CL/cl_usm_ext.h | 186 ------------------------------- sycl/include/CL/sycl/detail/pi.h | 3 - sycl/plugins/cuda/pi_cuda.cpp | 5 - 3 files changed, 194 deletions(-) delete mode 100644 sycl/include/CL/cl_usm_ext.h diff --git a/sycl/include/CL/cl_usm_ext.h b/sycl/include/CL/cl_usm_ext.h deleted file mode 100644 index 9f942a4e09c3..000000000000 --- a/sycl/include/CL/cl_usm_ext.h +++ /dev/null @@ -1,186 +0,0 @@ -//==---------------- cl_usm_ext.h - USM Extension for CL -------*- C++ -*---==// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -// ===--------------------------------------------------------------------=== // - -#pragma once - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/******************************************* - * cl_intel_unified_shared_memory extension * - ********************************************/ -#define cl_intel_unified_shared_memory 1 - -/* cl_device_info */ -#define CL_DEVICE_HOST_MEM_CAPABILITIES_INTEL 0x4190 -#define CL_DEVICE_DEVICE_MEM_CAPABILITIES_INTEL 0x4191 -#define CL_DEVICE_SINGLE_DEVICE_SHARED_MEM_CAPABILITIES_INTEL 0x4192 -#define CL_DEVICE_CROSS_DEVICE_SHARED_MEM_CAPABILITIES_INTEL 0x4193 -#define CL_DEVICE_SHARED_SYSTEM_MEM_CAPABILITIES_INTEL 0x4194 - -typedef cl_bitfield cl_device_unified_shared_memory_capabilities_intel; - -/* cl_device_unified_shared_memory_capabilities_intel - bitfield */ -#define CL_UNIFIED_SHARED_MEMORY_ACCESS_INTEL (1 << 0) -#define CL_UNIFIED_SHARED_MEMORY_ATOMIC_ACCESS_INTEL (1 << 1) -#define CL_UNIFIED_SHARED_MEMORY_CONCURRENT_ACCESS_INTEL (1 << 2) -#define CL_UNIFIED_SHARED_MEMORY_CONCURRENT_ATOMIC_ACCESS_INTEL (1 << 3) - -typedef cl_bitfield cl_mem_properties_intel; - -/* cl_mem_properties_intel */ -#define CL_MEM_ALLOC_FLAGS_INTEL 0x4195 - -typedef cl_bitfield cl_mem_alloc_flags_intel; - -/* cl_mem_alloc_flags_intel - bitfield */ -#define CL_MEM_ALLOC_DEFAULT_INTEL 0 -#define CL_MEM_ALLOC_WRITE_COMBINED_INTEL (1 << 0) - -typedef cl_uint cl_mem_info_intel; - -/* cl_mem_alloc_info_intel */ -#define CL_MEM_ALLOC_TYPE_INTEL 0x419A -#define CL_MEM_ALLOC_BASE_PTR_INTEL 0x419B -#define CL_MEM_ALLOC_SIZE_INTEL 0x419C -#define CL_MEM_ALLOC_DEVICE_INTEL 0x419D -/* CL_MEM_ALLOC_FLAGS_INTEL - defined above */ -#define CL_MEM_ALLOC_INFO_TBD0_INTEL 0x419E /* reserved for future */ -#define CL_MEM_ALLOC_INFO_TBD1_INTEL 0x419F /* reserved for future */ - -typedef cl_uint cl_unified_shared_memory_type_intel; - -/* cl_unified_shared_memory_type_intel */ -#define CL_MEM_TYPE_UNKNOWN_INTEL 0x4196 -#define CL_MEM_TYPE_HOST_INTEL 0x4197 -#define CL_MEM_TYPE_DEVICE_INTEL 0x4198 -#define CL_MEM_TYPE_SHARED_INTEL 0x4199 - -typedef cl_uint cl_mem_advice_intel; - -/* cl_mem_advice_intel */ -#define CL_MEM_ADVICE_TBD0_INTEL 0x4208 /* reserved for future */ -#define CL_MEM_ADVICE_TBD1_INTEL 0x4209 /* reserved for future */ -#define CL_MEM_ADVICE_TBD2_INTEL 0x420A /* reserved for future */ -#define CL_MEM_ADVICE_TBD3_INTEL 0x420B /* reserved for future */ -#define CL_MEM_ADVICE_TBD4_INTEL 0x420C /* reserved for future */ -#define CL_MEM_ADVICE_TBD5_INTEL 0x420D /* reserved for future */ -#define CL_MEM_ADVICE_TBD6_INTEL 0x420E /* reserved for future */ -#define CL_MEM_ADVICE_TBD7_INTEL 0x420F /* reserved for future */ - -/* cl_kernel_exec_info */ -#define CL_KERNEL_EXEC_INFO_INDIRECT_HOST_ACCESS_INTEL 0x4200 -#define CL_KERNEL_EXEC_INFO_INDIRECT_DEVICE_ACCESS_INTEL 0x4201 -#define CL_KERNEL_EXEC_INFO_INDIRECT_SHARED_ACCESS_INTEL 0x4202 -#define CL_KERNEL_EXEC_INFO_USM_PTRS_INTEL 0x4203 - -/* cl_command_type */ -#define CL_COMMAND_MEMSET_INTEL 0x4204 -#define CL_COMMAND_MEMCPY_INTEL 0x4205 -#define CL_COMMAND_MIGRATEMEM_INTEL 0x4206 -#define CL_COMMAND_MEMADVISE_INTEL 0x4207 - -extern CL_API_ENTRY void *CL_API_CALL -clHostMemAllocINTEL(cl_context context, - const cl_mem_properties_intel *properties, - size_t size, cl_uint alignment, cl_int *errcode_ret); - -typedef CL_API_ENTRY void *(CL_API_CALL *clHostMemAllocINTEL_fn)( - cl_context context, const cl_mem_properties_intel *properties, size_t size, - cl_uint alignment, cl_int *errcode_ret); - -extern CL_API_ENTRY void *CL_API_CALL -clDeviceMemAllocINTEL(cl_context context, cl_device_id device, - const cl_mem_properties_intel *properties, // TBD: needed? - size_t size, cl_uint alignment, cl_int *errcode_ret); - -typedef CL_API_ENTRY void *(CL_API_CALL *clDeviceMemAllocINTEL_fn)( - cl_context context, cl_device_id device, - const cl_mem_properties_intel *properties, // TBD: needed? - size_t size, cl_uint alignment, cl_int *errcode_ret); - -extern CL_API_ENTRY void *CL_API_CALL -clSharedMemAllocINTEL(cl_context context, cl_device_id device, - const cl_mem_properties_intel *properties, // TBD: needed? - size_t size, cl_uint alignment, cl_int *errcode_ret); - -typedef CL_API_ENTRY void *(CL_API_CALL *clSharedMemAllocINTEL_fn)( - cl_context context, cl_device_id device, - const cl_mem_properties_intel *properties, // TBD: needed? - size_t size, cl_uint alignment, cl_int *errcode_ret); - -extern CL_API_ENTRY cl_int CL_API_CALL -clMemFreeINTEL(cl_context context, - const void *ptr); // TBD: const? - -typedef CL_API_ENTRY -cl_int(CL_API_CALL *clMemFreeINTEL_fn)(cl_context context, - const void *ptr); // TBD: const? - -extern CL_API_ENTRY cl_int CL_API_CALL clGetMemAllocInfoINTEL( - cl_context context, const void *ptr, cl_mem_info_intel param_name, - size_t param_value_size, void *param_value, size_t *param_value_size_ret); - -typedef CL_API_ENTRY cl_int(CL_API_CALL *clGetMemAllocInfoINTEL_fn)( - cl_context context, const void *ptr, cl_mem_info_intel param_name, - size_t param_value_size, void *param_value, size_t *param_value_size_ret); - -extern CL_API_ENTRY cl_int CL_API_CALL clSetKernelArgMemPointerINTEL( - cl_kernel kernel, cl_uint arg_index, const void *arg_value); - -typedef CL_API_ENTRY cl_int(CL_API_CALL *clSetKernelArgMemPointerINTEL_fn)( - cl_kernel kernel, cl_uint arg_index, const void *arg_value); - -// TBD: Memset API vs. "fill" API. Is this sufficient? -extern CL_API_ENTRY cl_int CL_API_CALL -clEnqueueMemsetINTEL(cl_command_queue command_queue, void *dst_ptr, - cl_int value, size_t size, cl_uint num_events_in_wait_list, - const cl_event *event_wait_list, cl_event *event); - -// TBD: Memset API vs. "fill" API. Is this sufficient? -typedef CL_API_ENTRY cl_int(CL_API_CALL *clEnqueueMemsetINTEL_fn)( - cl_command_queue command_queue, void *dst_ptr, cl_int value, size_t size, - cl_uint num_events_in_wait_list, const cl_event *event_wait_list, - cl_event *event); - -extern CL_API_ENTRY cl_int CL_API_CALL clEnqueueMemcpyINTEL( - cl_command_queue command_queue, cl_bool blocking, void *dst_ptr, - const void *src_ptr, size_t size, cl_uint num_events_in_wait_list, - const cl_event *event_wait_list, cl_event *event); - -typedef CL_API_ENTRY cl_int(CL_API_CALL *clEnqueueMemcpyINTEL_fn)( - cl_command_queue command_queue, cl_bool blocking, void *dst_ptr, - const void *src_ptr, size_t size, cl_uint num_events_in_wait_list, - const cl_event *event_wait_list, cl_event *event); - -extern CL_API_ENTRY cl_int CL_API_CALL clEnqueueMigrateMemINTEL( - cl_command_queue command_queue, const void *ptr, size_t size, - cl_mem_migration_flags flags, cl_uint num_events_in_wait_list, - const cl_event *event_wait_list, cl_event *event); - -typedef CL_API_ENTRY cl_int(CL_API_CALL *clEnqueueMigrateMemINTEL_fn)( - cl_command_queue command_queue, const void *ptr, size_t size, - cl_mem_migration_flags flags, cl_uint num_events_in_wait_list, - const cl_event *event_wait_list, cl_event *event); - -extern CL_API_ENTRY cl_int CL_API_CALL clEnqueueMemAdviseINTEL( - cl_command_queue command_queue, const void *ptr, size_t size, - cl_mem_advice_intel advice, cl_uint num_events_in_wait_list, - const cl_event *event_wait_list, cl_event *event); - -typedef CL_API_ENTRY cl_int(CL_API_CALL *clEnqueueMemAdviseINTEL_fn)( - cl_command_queue command_queue, const void *ptr, size_t size, - cl_mem_advice_intel advice, cl_uint num_events_in_wait_list, - const cl_event *event_wait_list, cl_event *event); - -#ifdef __cplusplus -} -#endif diff --git a/sycl/include/CL/sycl/detail/pi.h b/sycl/include/CL/sycl/detail/pi.h index 0a531fb44dc9..60d6e3384e83 100644 --- a/sycl/include/CL/sycl/detail/pi.h +++ b/sycl/include/CL/sycl/detail/pi.h @@ -46,7 +46,6 @@ // elsewhere, e.g. in the pi_opencl, but constants/enums mapping is now // done here, for efficiency and simplicity. #include -#include #include #include #include @@ -1340,8 +1339,6 @@ typedef enum { PI_MEM_ALLOC_BASE_PTR = CL_MEM_ALLOC_BASE_PTR_INTEL, PI_MEM_ALLOC_SIZE = CL_MEM_ALLOC_SIZE_INTEL, PI_MEM_ALLOC_DEVICE = CL_MEM_ALLOC_DEVICE_INTEL, - PI_MEM_ALLOC_INFO_TBD0 = CL_MEM_ALLOC_INFO_TBD0_INTEL, - PI_MEM_ALLOC_INFO_TBD1 = CL_MEM_ALLOC_INFO_TBD1_INTEL, } _pi_mem_info; typedef enum { diff --git a/sycl/plugins/cuda/pi_cuda.cpp b/sycl/plugins/cuda/pi_cuda.cpp index 460dbe56ab2e..ae7bb86c87b5 100644 --- a/sycl/plugins/cuda/pi_cuda.cpp +++ b/sycl/plugins/cuda/pi_cuda.cpp @@ -3611,11 +3611,6 @@ pi_result cuda_piextUSMGetMemAllocInfo(pi_context context, const void *ptr, return getInfo(param_value_size, param_value, param_value_size_ret, device); } - // not documented/implemented yet - case PI_MEM_ALLOC_INFO_TBD0: - case PI_MEM_ALLOC_INFO_TBD1: { - return PI_INVALID_VALUE; - } } } catch (pi_result error) { result = error;