Skip to content

Commit af0018d

Browse files
author
Jaime Arteaga
committed
[SYCL][UR] Add stubs in L0 adapter
Signed-off-by: Jaime Arteaga <jaime.a.arteaga.molina@intel.com>
1 parent 97b833b commit af0018d

9 files changed

+1475
-0
lines changed

sycl/plugins/unified_runtime/ur/adapters/level_zero/ur_level_zero_context.cpp

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,76 @@
1313
#include "ur_level_zero.hpp"
1414
#include "ur_level_zero_context.hpp"
1515
#include <ur_bindings.hpp>
16+
17+
UR_APIEXPORT ur_result_t UR_APICALL urContextCreate(
18+
uint32_t DeviceCount, ///< [in] the number of devices given in phDevices
19+
ur_device_handle_t
20+
*phDevices, ///< [in][range(0, DeviceCount)] array of handle of devices.
21+
ur_context_handle_t
22+
*phContext ///< [out] pointer to handle of context object created
23+
) {
24+
zePrint("[UR][L0] %s function not implemented!\n", __FUNCTION__);
25+
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
26+
}
27+
28+
UR_APIEXPORT ur_result_t UR_APICALL urContextRetain(
29+
ur_context_handle_t
30+
hContext ///< [in] handle of the context to get a reference of.
31+
) {
32+
zePrint("[UR][L0] %s function not implemented!\n", __FUNCTION__);
33+
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
34+
}
35+
36+
UR_APIEXPORT ur_result_t UR_APICALL urContextRelease(
37+
ur_context_handle_t hContext ///< [in] handle of the context to release.
38+
) {
39+
zePrint("[UR][L0] %s function not implemented!\n", __FUNCTION__);
40+
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
41+
}
42+
43+
UR_APIEXPORT ur_result_t UR_APICALL urContextGetInfo(
44+
ur_context_handle_t hContext, ///< [in] handle of the context
45+
ur_context_info_t ContextInfoType, ///< [in] type of the info to retrieve
46+
size_t propSize, ///< [in] the number of bytes of memory pointed to by
47+
///< pContextInfo.
48+
void *pContextInfo, ///< [out][optional] array of bytes holding the info.
49+
///< if propSize is not equal to or greater than the
50+
///< real number of bytes needed to return the info then
51+
///< the ::UR_RESULT_ERROR_INVALID_SIZE error is
52+
///< returned and pContextInfo is not used.
53+
size_t *pPropSizeRet ///< [out][optional] pointer to the actual size in
54+
///< bytes of data queried by ContextInfoType.
55+
) {
56+
zePrint("[UR][L0] %s function not implemented!\n", __FUNCTION__);
57+
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
58+
}
59+
60+
UR_APIEXPORT ur_result_t UR_APICALL urContextGetNativeHandle(
61+
ur_context_handle_t hContext, ///< [in] handle of the context.
62+
ur_native_handle_t *phNativeContext ///< [out] a pointer to the native
63+
///< handle of the context.
64+
) {
65+
zePrint("[UR][L0] %s function not implemented!\n", __FUNCTION__);
66+
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
67+
}
68+
69+
UR_APIEXPORT ur_result_t UR_APICALL urContextCreateWithNativeHandle(
70+
ur_native_handle_t
71+
hNativeContext, ///< [in] the native handle of the context.
72+
ur_context_handle_t *phContext ///< [out] pointer to the handle of the
73+
///< context object created.
74+
) {
75+
zePrint("[UR][L0] %s function not implemented!\n", __FUNCTION__);
76+
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
77+
}
78+
79+
UR_APIEXPORT ur_result_t UR_APICALL urContextSetExtendedDeleter(
80+
ur_context_handle_t hContext, ///< [in] handle of the context.
81+
ur_context_extended_deleter_t
82+
pfnDeleter, ///< [in] Function pointer to extended deleter.
83+
void *pUserData ///< [in][out][optional] pointer to data to be passed to
84+
///< callback.
85+
) {
86+
zePrint("[UR][L0] %s function not implemented!\n", __FUNCTION__);
87+
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
88+
}

sycl/plugins/unified_runtime/ur/adapters/level_zero/ur_level_zero_device.cpp

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,51 @@
1313
#include "ur_level_zero.hpp"
1414
#include "ur_level_zero_device.hpp"
1515
#include <ur_bindings.hpp>
16+
17+
UR_APIEXPORT ur_result_t UR_APICALL urDeviceSelectBinary(
18+
ur_device_handle_t
19+
hDevice, ///< [in] handle of the device to select binary for.
20+
const uint8_t **ppBinaries, ///< [in] the array of binaries to select from.
21+
uint32_t NumBinaries, ///< [in] the number of binaries passed in ppBinaries.
22+
///< Must greater than or equal to zero otherwise
23+
///< ::UR_RESULT_ERROR_INVALID_VALUE is returned.
24+
uint32_t *
25+
pSelectedBinary ///< [out] the index of the selected binary in the input
26+
///< array of binaries. If a suitable binary was not
27+
///< found the function returns ${X}_INVALID_BINARY.
28+
) {
29+
zePrint("[UR][L0] %s function not implemented!\n", __FUNCTION__);
30+
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
31+
}
32+
33+
UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetNativeHandle(
34+
ur_device_handle_t hDevice, ///< [in] handle of the device.
35+
ur_native_handle_t
36+
*phNativeDevice ///< [out] a pointer to the native handle of the device.
37+
) {
38+
zePrint("[UR][L0] %s function not implemented!\n", __FUNCTION__);
39+
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
40+
}
41+
42+
UR_APIEXPORT ur_result_t UR_APICALL urDeviceCreateWithNativeHandle(
43+
ur_native_handle_t hNativeDevice, ///< [in] the native handle of the device.
44+
ur_platform_handle_t hPlatform, ///< [in] handle of the platform instance
45+
ur_device_handle_t
46+
*phDevice ///< [out] pointer to the handle of the device object created.
47+
) {
48+
zePrint("[UR][L0] %s function not implemented!\n", __FUNCTION__);
49+
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
50+
}
51+
52+
UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetGlobalTimestamps(
53+
ur_device_handle_t hDevice, ///< [in] handle of the device instance
54+
uint64_t *pDeviceTimestamp, ///< [out][optional] pointer to the Device's
55+
///< global timestamp that correlates with the
56+
///< Host's global timestamp value
57+
uint64_t *pHostTimestamp ///< [out][optional] pointer to the Host's global
58+
///< timestamp that correlates with the Device's
59+
///< global timestamp value
60+
) {
61+
zePrint("[UR][L0] %s function not implemented!\n", __FUNCTION__);
62+
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
63+
}

sycl/plugins/unified_runtime/ur/adapters/level_zero/ur_level_zero_event.cpp

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,114 @@
1313
#include "ur_level_zero.hpp"
1414
#include "ur_level_zero_event.hpp"
1515
#include <ur_bindings.hpp>
16+
17+
UR_APIEXPORT ur_result_t UR_APICALL urEnqueueEventsWait(
18+
ur_queue_handle_t hQueue, ///< [in] handle of the queue object
19+
uint32_t numEventsInWaitList, ///< [in] size of the event wait list
20+
const ur_event_handle_t *
21+
phEventWaitList, ///< [in][optional][range(0, numEventsInWaitList)]
22+
///< pointer to a list of events that must be complete
23+
///< before this command can be executed. If nullptr,
24+
///< the numEventsInWaitList must be 0, indicating that
25+
///< all previously enqueued commands must be complete.
26+
ur_event_handle_t
27+
*phEvent ///< [in,out][optional] return an event object that identifies
28+
///< this particular command instance.
29+
) {
30+
zePrint("[UR][L0] %s function not implemented!\n", __FUNCTION__);
31+
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
32+
}
33+
34+
UR_APIEXPORT ur_result_t UR_APICALL urEnqueueEventsWaitWithBarrier(
35+
ur_queue_handle_t hQueue, ///< [in] handle of the queue object
36+
uint32_t numEventsInWaitList, ///< [in] size of the event wait list
37+
const ur_event_handle_t *
38+
phEventWaitList, ///< [in][optional][range(0, numEventsInWaitList)]
39+
///< pointer to a list of events that must be complete
40+
///< before this command can be executed. If nullptr,
41+
///< the numEventsInWaitList must be 0, indicating that
42+
///< all previously enqueued commands must be complete.
43+
ur_event_handle_t
44+
*phEvent ///< [in,out][optional] return an event object that identifies
45+
///< this particular command instance.
46+
) {
47+
zePrint("[UR][L0] %s function not implemented!\n", __FUNCTION__);
48+
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
49+
}
50+
51+
UR_APIEXPORT ur_result_t UR_APICALL urEventGetInfo(
52+
ur_event_handle_t hEvent, ///< [in] handle of the event object
53+
ur_event_info_t propName, ///< [in] the name of the event property to query
54+
size_t propValueSize, ///< [in] size in bytes of the event property value
55+
void *pPropValue, ///< [out][optional] value of the event property
56+
size_t
57+
*pPropValueSizeRet ///< [out][optional] bytes returned in event property
58+
);
59+
60+
UR_APIEXPORT ur_result_t UR_APICALL urEventGetProfilingInfo(
61+
ur_event_handle_t hEvent, ///< [in] handle of the event object
62+
ur_profiling_info_t
63+
propName, ///< [in] the name of the profiling property to query
64+
size_t
65+
propValueSize, ///< [in] size in bytes of the profiling property value
66+
void *pPropValue, ///< [out][optional] value of the profiling property
67+
size_t *pPropValueSizeRet ///< [out][optional] pointer to the actual size in
68+
///< bytes returned in propValue
69+
) {
70+
zePrint("[UR][L0] %s function not implemented!\n", __FUNCTION__);
71+
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
72+
}
73+
74+
UR_APIEXPORT ur_result_t UR_APICALL urEventWait(
75+
uint32_t numEvents, ///< [in] number of events in the event list
76+
const ur_event_handle_t
77+
*phEventWaitList ///< [in][range(0, numEvents)] pointer to a list of
78+
///< events to wait for completion
79+
) {
80+
zePrint("[UR][L0] %s function not implemented!\n", __FUNCTION__);
81+
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
82+
}
83+
84+
UR_APIEXPORT ur_result_t UR_APICALL urEventRetain(
85+
ur_event_handle_t hEvent ///< [in] handle of the event object
86+
) {
87+
zePrint("[UR][L0] %s function not implemented!\n", __FUNCTION__);
88+
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
89+
}
90+
91+
UR_APIEXPORT ur_result_t UR_APICALL urEventRelease(
92+
ur_event_handle_t hEvent ///< [in] handle of the event object
93+
) {
94+
zePrint("[UR][L0] %s function not implemented!\n", __FUNCTION__);
95+
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
96+
}
97+
98+
UR_APIEXPORT ur_result_t UR_APICALL urEventGetNativeHandle(
99+
ur_event_handle_t hEvent, ///< [in] handle of the event.
100+
ur_native_handle_t
101+
*phNativeEvent ///< [out] a pointer to the native handle of the event.
102+
) {
103+
zePrint("[UR][L0] %s function not implemented!\n", __FUNCTION__);
104+
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
105+
}
106+
107+
UR_APIEXPORT ur_result_t UR_APICALL urEventCreateWithNativeHandle(
108+
ur_native_handle_t hNativeEvent, ///< [in] the native handle of the event.
109+
ur_context_handle_t hContext, ///< [in] handle of the context object
110+
ur_event_handle_t
111+
*phEvent ///< [out] pointer to the handle of the event object created.
112+
) {
113+
zePrint("[UR][L0] %s function not implemented!\n", __FUNCTION__);
114+
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
115+
}
116+
117+
UR_APIEXPORT ur_result_t UR_APICALL urEventSetCallback(
118+
ur_event_handle_t hEvent, ///< [in] handle of the event object
119+
ur_execution_info_t execStatus, ///< [in] execution status of the event
120+
ur_event_callback_t pfnNotify, ///< [in] execution status of the event
121+
void *pUserData ///< [in][out][optional] pointer to data to be passed to
122+
///< callback.
123+
) {
124+
zePrint("[UR][L0] %s function not implemented!\n", __FUNCTION__);
125+
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
126+
}

0 commit comments

Comments
 (0)