Skip to content

Commit 7839346

Browse files
author
Hugh Delaney
committed
Add entry points for L0, HIP and openCL adapters
All entry points unsupported for now. Add Entry Point to UR interface loaders
1 parent 2acb536 commit 7839346

File tree

10 files changed

+63
-0
lines changed

10 files changed

+63
-0
lines changed

source/adapters/cuda/ur_interface_loader.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,7 @@ UR_DLLEXPORT ur_result_t UR_APICALL urGetEnqueueExpProcAddrTable(
411411
urEnqueueCooperativeKernelLaunchExp;
412412
pDdiTable->pfnTimestampRecordingExp = urEnqueueTimestampRecordingExp;
413413
pDdiTable->pfnKernelLaunchCustomExp = urEnqueueKernelLaunchCustomExp;
414+
pDdiTable->pfnNativeCommandExp = urEnqueueNativeCommandExp;
414415

415416
return UR_RESULT_SUCCESS;
416417
}

source/adapters/hip/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ add_ur_adapter(${TARGET_NAME}
6363
${CMAKE_CURRENT_SOURCE_DIR}/device.hpp
6464
${CMAKE_CURRENT_SOURCE_DIR}/device.cpp
6565
${CMAKE_CURRENT_SOURCE_DIR}/enqueue.cpp
66+
${CMAKE_CURRENT_SOURCE_DIR}/enqueue_native.cpp
6667
${CMAKE_CURRENT_SOURCE_DIR}/event.hpp
6768
${CMAKE_CURRENT_SOURCE_DIR}/event.cpp
6869
${CMAKE_CURRENT_SOURCE_DIR}/image.cpp
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
//===--------- enqueue_native.cpp - HIP Adapter ---------------------------===//
2+
//
3+
// Copyright (C) 2024 Intel Corporation
4+
//
5+
// Part of the Unified-Runtime Project, under the Apache License v2.0 with LLVM
6+
// Exceptions. See LICENSE.TXT
7+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
8+
//
9+
//===----------------------------------------------------------------------===//
10+
11+
#include <ur_api.h>
12+
13+
UR_APICALL UR_APIEXPORT ur_result_t urEnqueueNativeCommandExp(
14+
ur_queue_handle_t, ur_exp_enqueue_native_command_function_t, void *,
15+
const ur_exp_enqueue_native_command_properties_t *,
16+
uint32_t, const ur_event_handle_t *, ur_event_handle_t *) {
17+
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
18+
}
19+

source/adapters/hip/ur_interface_loader.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,7 @@ UR_DLLEXPORT ur_result_t UR_APICALL urGetEnqueueExpProcAddrTable(
379379
pDdiTable->pfnCooperativeKernelLaunchExp =
380380
urEnqueueCooperativeKernelLaunchExp;
381381
pDdiTable->pfnTimestampRecordingExp = urEnqueueTimestampRecordingExp;
382+
pDdiTable->pfnNativeCommandExp = urEnqueueNativeCommandExp;
382383

383384
return UR_RESULT_SUCCESS;
384385
}

source/adapters/level_zero/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ add_ur_adapter(${TARGET_NAME}
116116
${CMAKE_CURRENT_SOURCE_DIR}/common.cpp
117117
${CMAKE_CURRENT_SOURCE_DIR}/context.cpp
118118
${CMAKE_CURRENT_SOURCE_DIR}/device.cpp
119+
${CMAKE_CURRENT_SOURCE_DIR}/enqueue_native.cpp
119120
${CMAKE_CURRENT_SOURCE_DIR}/event.cpp
120121
${CMAKE_CURRENT_SOURCE_DIR}/usm.cpp
121122
${CMAKE_CURRENT_SOURCE_DIR}/usm_p2p.cpp
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//===--------- enqueue_native.cpp - LevelZero Adapter ---------------------===//
2+
//
3+
// Copyright (C) 2024 Intel Corporation
4+
//
5+
// Part of the Unified-Runtime Project, under the Apache License v2.0 with LLVM
6+
// Exceptions. See LICENSE.TXT
7+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
8+
//
9+
//===----------------------------------------------------------------------===//
10+
11+
#include <ur_api.h>
12+
13+
UR_APICALL UR_APIEXPORT ur_result_t urEnqueueNativeCommandExp(
14+
ur_queue_handle_t, ur_exp_enqueue_native_command_function_t, void *,
15+
const ur_exp_enqueue_native_command_properties_t *,
16+
uint32_t, const ur_event_handle_t *, ur_event_handle_t *) {
17+
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
18+
}

source/adapters/level_zero/ur_interface_loader.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,7 @@ UR_DLLEXPORT ur_result_t UR_APICALL urGetEnqueueExpProcAddrTable(
459459
pDdiTable->pfnCooperativeKernelLaunchExp =
460460
urEnqueueCooperativeKernelLaunchExp;
461461
pDdiTable->pfnTimestampRecordingExp = urEnqueueTimestampRecordingExp;
462+
pDdiTable->pfnNativeCommandExp = urEnqueueNativeCommandExp;
462463

463464
return UR_RESULT_SUCCESS;
464465
}

source/adapters/opencl/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ add_ur_adapter(${TARGET_NAME} SHARED
2525
${CMAKE_CURRENT_SOURCE_DIR}/device.hpp
2626
${CMAKE_CURRENT_SOURCE_DIR}/device.cpp
2727
${CMAKE_CURRENT_SOURCE_DIR}/enqueue.cpp
28+
${CMAKE_CURRENT_SOURCE_DIR}/enqueue_native.cpp
2829
${CMAKE_CURRENT_SOURCE_DIR}/event.cpp
2930
${CMAKE_CURRENT_SOURCE_DIR}/image.cpp
3031
${CMAKE_CURRENT_SOURCE_DIR}/kernel.cpp
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
//===--------- enqueue_native.cpp - OpenCL Adapter ------------------------===//
2+
//
3+
// Copyright (C) 2024 Intel Corporation
4+
//
5+
// Part of the Unified-Runtime Project, under the Apache License v2.0 with LLVM
6+
// Exceptions. See LICENSE.TXT
7+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
8+
//
9+
//===----------------------------------------------------------------------===//
10+
11+
#include <ur_api.h>
12+
13+
UR_APICALL UR_APIEXPORT ur_result_t urEnqueueNativeCommandExp(
14+
ur_queue_handle_t, ur_exp_enqueue_native_command_function_t, void *,
15+
const ur_exp_enqueue_native_command_properties_t *,
16+
uint32_t, const ur_event_handle_t *, ur_event_handle_t *) {
17+
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
18+
}
19+

source/adapters/opencl/ur_interface_loader.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,7 @@ UR_DLLEXPORT ur_result_t UR_APICALL urGetEnqueueExpProcAddrTable(
401401
pDdiTable->pfnCooperativeKernelLaunchExp =
402402
urEnqueueCooperativeKernelLaunchExp;
403403
pDdiTable->pfnTimestampRecordingExp = urEnqueueTimestampRecordingExp;
404+
pDdiTable->pfnNativeCommandExp = urEnqueueNativeCommandExp;
404405

405406
return UR_RESULT_SUCCESS;
406407
}

0 commit comments

Comments
 (0)