Skip to content

Commit

Permalink
Support local_accessor kernel arguments.
Browse files Browse the repository at this point in the history
    - Adds support in libsyclinterface:: dpctl_sycl_queue_interface for
      sycl::local_accessor as kernel arguments.
    - Refactoring to get rid of compiler warnings.
  • Loading branch information
Diptorup Deb committed Feb 29, 2024
1 parent 7ab3731 commit 9e0754f
Show file tree
Hide file tree
Showing 5 changed files with 272 additions and 64 deletions.
26 changes: 26 additions & 0 deletions dpctl/enum_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"device_type",
"backend_type",
"event_status_type",
"kernel_arg_type",
]


Expand Down Expand Up @@ -113,3 +114,28 @@ class global_mem_cache_type(Enum):
none = auto()
read_only = auto()
read_write = auto()


class kernel_arg_type(Enum):
"""
An enumeration of supported kernel argument types in
:func:`dpctl.SyclQueue.submit`
"""

dpctl_char = auto()
dpctl_signed_char = auto()
dpctl_unsigned_char = auto()
dpctl_short = auto()
dpctl_int = auto()
dpctl_unsigned_int = auto()
dpctl_unsigned_int8 = auto()
dpctl_long = auto()
dpctl_unsigned_long = auto()
dpctl_long_long = auto()
dpctl_unsigned_long_long = auto()
dpctl_size_t = auto()
dpctl_float = auto()
dpctl_double = auto()
dpctl_long_double = auto()
dpctl_void_ptr = auto()
dpctl_local_accessor = auto()
2 changes: 1 addition & 1 deletion libsyclinterface/helper/include/dpctl_error_handlers.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
///
/// \file
/// A functor to use for passing an error handler callback function to sycl
/// context and queue contructors.
/// context and queue constructors.
//===----------------------------------------------------------------------===//

#pragma once
Expand Down
3 changes: 2 additions & 1 deletion libsyclinterface/include/dpctl_sycl_enum_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ typedef enum
DPCTL_FLOAT,
DPCTL_DOUBLE,
DPCTL_LONG_DOUBLE,
DPCTL_VOID_PTR
DPCTL_VOID_PTR,
DPCTL_LOCAL_ACCESSOR
} DPCTLKernelArgType;

/*!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ _GetKernel_ze_impl(const kernel_bundle<bundle_state::executable> &kb,
else {
error_handler("Kernel named " + std::string(kernel_name) +
" could not be found.",
__FILE__, __func__, __LINE__);
__FILE__, __func__, __LINE__, error_level::error);
return nullptr;
}
}
Expand All @@ -541,7 +541,7 @@ bool _HasKernel_ze_impl(const kernel_bundle<bundle_state::executable> &kb,
auto zeKernelCreateFn = get_zeKernelCreate();
if (zeKernelCreateFn == nullptr) {
error_handler("Could not load zeKernelCreate function.", __FILE__,
__func__, __LINE__);
__func__, __LINE__, error_level::error);
return false;
}

Expand All @@ -564,7 +564,7 @@ bool _HasKernel_ze_impl(const kernel_bundle<bundle_state::executable> &kb,
if (ze_status != ZE_RESULT_ERROR_INVALID_KERNEL_NAME) {
error_handler("zeKernelCreate failed: " +
_GetErrorCode_ze_impl(ze_status),
__FILE__, __func__, __LINE__);
__FILE__, __func__, __LINE__, error_level::error);
return false;
}
}
Expand Down
Loading

0 comments on commit 9e0754f

Please sign in to comment.