Skip to content

Commit 70d71b3

Browse files
committed
[intel] specialized kernels
1 parent 2b61b09 commit 70d71b3

File tree

2 files changed

+256
-209
lines changed

2 files changed

+256
-209
lines changed

third_party/intel/backend/include/sycl_functions.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,8 @@ inline std::optional<bool> isEnvValueBool(std::string str) {
143143
return std::nullopt;
144144
}
145145

146+
static constexpr int kBlockIOPitchSpecId = 123;
147+
146148
std::tuple<ze_module_handle_t, ze_result_t>
147149
create_module(ze_context_handle_t context, ze_device_handle_t device,
148150
uint8_t *binary_ptr, size_t binary_size, const char *build_flags,
@@ -152,12 +154,25 @@ create_module(ze_context_handle_t context, ze_device_handle_t device,
152154

153155
const ze_module_format_t format =
154156
is_spv ? ZE_MODULE_FORMAT_IL_SPIRV : ZE_MODULE_FORMAT_NATIVE;
157+
158+
uint64_t pitchBytesMode = 0u; // TODO just for test, remove
159+
160+
ze_module_constants_t specConsts{};
161+
uint32_t ids[] = {kBlockIOPitchSpecId};
162+
uint64_t values[] = {pitchBytesMode};
163+
164+
specConsts.numConstants = 1;
165+
specConsts.pConstantIds = ids;
166+
specConsts.pConstantValues = values;
167+
155168
ze_module_desc_t module_description = {};
156169
module_description.stype = ZE_STRUCTURE_TYPE_MODULE_DESC;
157170
module_description.format = format;
158171
module_description.inputSize = static_cast<uint32_t>(binary_size);
159172
module_description.pInputModule = binary_ptr;
160173
module_description.pBuildFlags = build_flags;
174+
module_description.pConstants = &specConsts;
175+
161176
ze_module_build_log_handle_t buildlog;
162177
ze_module_handle_t module;
163178
auto error_no =

0 commit comments

Comments
 (0)