Skip to content

Commit 1589677

Browse files
author
Diptorup Deb
committed
Support local_accessor kernel arguments.
- Adds support in libsyclinterface:: dpctl_sycl_queue_interface for sycl::local_accessor as kernel arguments. - Refactoring to get rid of compiler warnings.
1 parent 1465451 commit 1589677

File tree

5 files changed

+272
-64
lines changed

5 files changed

+272
-64
lines changed

dpctl/enum_types.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"device_type",
2727
"backend_type",
2828
"event_status_type",
29+
"kernel_arg_type",
2930
]
3031

3132

@@ -113,3 +114,28 @@ class global_mem_cache_type(Enum):
113114
none = auto()
114115
read_only = auto()
115116
read_write = auto()
117+
118+
119+
class kernel_arg_type(Enum):
120+
"""
121+
An enumeration of supported kernel argument types in
122+
:func:`dpctl.SyclQueue.submit`
123+
"""
124+
125+
dpctl_char = auto()
126+
dpctl_signed_char = auto()
127+
dpctl_unsigned_char = auto()
128+
dpctl_short = auto()
129+
dpctl_int = auto()
130+
dpctl_unsigned_int = auto()
131+
dpctl_unsigned_int8 = auto()
132+
dpctl_long = auto()
133+
dpctl_unsigned_long = auto()
134+
dpctl_long_long = auto()
135+
dpctl_unsigned_long_long = auto()
136+
dpctl_size_t = auto()
137+
dpctl_float = auto()
138+
dpctl_double = auto()
139+
dpctl_long_double = auto()
140+
dpctl_void_ptr = auto()
141+
dpctl_local_accessor = auto()

libsyclinterface/helper/include/dpctl_error_handlers.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
///
2121
/// \file
2222
/// A functor to use for passing an error handler callback function to sycl
23-
/// context and queue contructors.
23+
/// context and queue constructors.
2424
//===----------------------------------------------------------------------===//
2525

2626
#pragma once

libsyclinterface/include/dpctl_sycl_enum_types.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@ typedef enum
102102
DPCTL_FLOAT,
103103
DPCTL_DOUBLE,
104104
DPCTL_LONG_DOUBLE,
105-
DPCTL_VOID_PTR
105+
DPCTL_VOID_PTR,
106+
DPCTL_LOCAL_ACCESSOR
106107
} DPCTLKernelArgType;
107108

108109
/*!

libsyclinterface/source/dpctl_sycl_kernel_bundle_interface.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ _GetKernel_ze_impl(const kernel_bundle<bundle_state::executable> &kb,
530530
else {
531531
error_handler("Kernel named " + std::string(kernel_name) +
532532
" could not be found.",
533-
__FILE__, __func__, __LINE__);
533+
__FILE__, __func__, __LINE__, error_level::error);
534534
return nullptr;
535535
}
536536
}
@@ -541,7 +541,7 @@ bool _HasKernel_ze_impl(const kernel_bundle<bundle_state::executable> &kb,
541541
auto zeKernelCreateFn = get_zeKernelCreate();
542542
if (zeKernelCreateFn == nullptr) {
543543
error_handler("Could not load zeKernelCreate function.", __FILE__,
544-
__func__, __LINE__);
544+
__func__, __LINE__, error_level::error);
545545
return false;
546546
}
547547

@@ -564,7 +564,7 @@ bool _HasKernel_ze_impl(const kernel_bundle<bundle_state::executable> &kb,
564564
if (ze_status != ZE_RESULT_ERROR_INVALID_KERNEL_NAME) {
565565
error_handler("zeKernelCreate failed: " +
566566
_GetErrorCode_ze_impl(ze_status),
567-
__FILE__, __func__, __LINE__);
567+
__FILE__, __func__, __LINE__, error_level::error);
568568
return false;
569569
}
570570
}

0 commit comments

Comments
 (0)