Skip to content

Commit 62685f4

Browse files
committed
Merge changes from multi device compile extension into core spec.
1 parent df6da35 commit 62685f4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+382
-2177
lines changed

examples/codegen/codegen.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ int main() {
118118
ur_program_handle_t hProgram;
119119
ur_check(urProgramCreateWithIL(hContext, spv.data(), spv.size(), nullptr,
120120
&hProgram));
121-
ur_check(urProgramBuild(hContext, hProgram, nullptr));
121+
ur_check(urProgramBuild(hProgram, 1, &current_device, nullptr));
122122

123123
ur_mem_handle_t dA, dB;
124124
ur_check(urMemBufferCreate(hContext, UR_MEM_FLAG_READ_WRITE,

include/ur_api.h

Lines changed: 23 additions & 176 deletions
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,6 @@ typedef enum ur_function_t {
193193
UR_FUNCTION_ADAPTER_RETAIN = 179, ///< Enumerator for ::urAdapterRetain
194194
UR_FUNCTION_ADAPTER_GET_LAST_ERROR = 180, ///< Enumerator for ::urAdapterGetLastError
195195
UR_FUNCTION_ADAPTER_GET_INFO = 181, ///< Enumerator for ::urAdapterGetInfo
196-
UR_FUNCTION_PROGRAM_BUILD_EXP = 197, ///< Enumerator for ::urProgramBuildExp
197-
UR_FUNCTION_PROGRAM_COMPILE_EXP = 198, ///< Enumerator for ::urProgramCompileExp
198-
UR_FUNCTION_PROGRAM_LINK_EXP = 199, ///< Enumerator for ::urProgramLinkExp
199196
UR_FUNCTION_LOADER_CONFIG_SET_CODE_LOCATION_CALLBACK = 200, ///< Enumerator for ::urLoaderConfigSetCodeLocationCallback
200197
UR_FUNCTION_LOADER_INIT = 201, ///< Enumerator for ::urLoaderInit
201198
UR_FUNCTION_LOADER_TEAR_DOWN = 202, ///< Enumerator for ::urLoaderTearDown
@@ -4263,17 +4260,21 @@ urProgramCreateWithBinary(
42634260
/// - ::UR_RESULT_ERROR_DEVICE_LOST
42644261
/// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC
42654262
/// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE
4266-
/// + `NULL == hContext`
42674263
/// + `NULL == hProgram`
4264+
/// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER
4265+
/// + `NULL == phDevices`
42684266
/// - ::UR_RESULT_ERROR_INVALID_PROGRAM
42694267
/// + If `hProgram` isn't a valid program object.
42704268
/// - ::UR_RESULT_ERROR_PROGRAM_BUILD_FAILURE
42714269
/// + If an error occurred when building `hProgram`.
4270+
/// - ::UR_RESULT_ERROR_INVALID_SIZE
4271+
/// + `numDevices == 0`
42724272
UR_APIEXPORT ur_result_t UR_APICALL
42734273
urProgramBuild(
4274-
ur_context_handle_t hContext, ///< [in] handle of the context instance.
4275-
ur_program_handle_t hProgram, ///< [in] Handle of the program to build.
4276-
const char *pOptions ///< [in][optional] pointer to build options null-terminated string.
4274+
ur_program_handle_t hProgram, ///< [in] Handle of the program to build.
4275+
uint32_t numDevices, ///< [in] length of `phDevices`
4276+
ur_device_handle_t *phDevices, ///< [in][range(0, numDevices)] pointer to array of device handles
4277+
const char *pOptions ///< [in][optional] pointer to build options null-terminated string.
42774278
);
42784279

42794280
///////////////////////////////////////////////////////////////////////////////
@@ -4295,17 +4296,21 @@ urProgramBuild(
42954296
/// - ::UR_RESULT_ERROR_DEVICE_LOST
42964297
/// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC
42974298
/// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE
4298-
/// + `NULL == hContext`
42994299
/// + `NULL == hProgram`
4300+
/// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER
4301+
/// + `NULL == phDevices`
43004302
/// - ::UR_RESULT_ERROR_INVALID_PROGRAM
43014303
/// + If `hProgram` isn't a valid program object.
43024304
/// - ::UR_RESULT_ERROR_PROGRAM_BUILD_FAILURE
43034305
/// + If an error occurred while compiling `hProgram`.
4306+
/// - ::UR_RESULT_ERROR_INVALID_SIZE
4307+
/// + `numDevices == 0`
43044308
UR_APIEXPORT ur_result_t UR_APICALL
43054309
urProgramCompile(
4306-
ur_context_handle_t hContext, ///< [in] handle of the context instance.
4307-
ur_program_handle_t hProgram, ///< [in][out] handle of the program to compile.
4308-
const char *pOptions ///< [in][optional] pointer to build options null-terminated string.
4310+
ur_program_handle_t hProgram, ///< [in][out] handle of the program to compile.
4311+
uint32_t numDevices, ///< [in] length of `phDevices`
4312+
ur_device_handle_t *phDevices, ///< [in][range(0, numDevices)] pointer to array of device handles
4313+
const char *pOptions ///< [in][optional] pointer to build options null-terminated string.
43094314
);
43104315

43114316
///////////////////////////////////////////////////////////////////////////////
@@ -4335,17 +4340,21 @@ urProgramCompile(
43354340
/// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE
43364341
/// + `NULL == hContext`
43374342
/// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER
4343+
/// + `NULL == phDevices`
43384344
/// + `NULL == phPrograms`
43394345
/// + `NULL == phProgram`
43404346
/// - ::UR_RESULT_ERROR_INVALID_PROGRAM
43414347
/// + If one of the programs in `phPrograms` isn't a valid program object.
43424348
/// - ::UR_RESULT_ERROR_INVALID_SIZE
4349+
/// + `numDevices == 0`
43434350
/// + `count == 0`
43444351
/// - ::UR_RESULT_ERROR_PROGRAM_LINK_FAILURE
43454352
/// + If an error occurred while linking `phPrograms`.
43464353
UR_APIEXPORT ur_result_t UR_APICALL
43474354
urProgramLink(
43484355
ur_context_handle_t hContext, ///< [in] handle of the context instance.
4356+
uint32_t numDevices, ///< [in] number of devices
4357+
ur_device_handle_t *phDevices, ///< [in][range(0, numDevices)] pointer to array of device handles
43494358
uint32_t count, ///< [in] number of program handles in `phPrograms`.
43504359
const ur_program_handle_t *phPrograms, ///< [in][range(0, count)] pointer to array of program handles.
43514360
const char *pOptions, ///< [in][optional] pointer to linker options null-terminated string.
@@ -9318,136 +9327,6 @@ urEnqueueKernelLaunchCustomExp(
93189327
///< kernel execution instance.
93199328
);
93209329

9321-
#if !defined(__GNUC__)
9322-
#pragma endregion
9323-
#endif
9324-
// Intel 'oneAPI' Unified Runtime Experimental APIs for multi-device compile
9325-
#if !defined(__GNUC__)
9326-
#pragma region multi_device_compile_(experimental)
9327-
#endif
9328-
///////////////////////////////////////////////////////////////////////////////
9329-
#ifndef UR_MULTI_DEVICE_COMPILE_EXTENSION_STRING_EXP
9330-
/// @brief The extension string which defines support for test
9331-
/// which is returned when querying device extensions.
9332-
#define UR_MULTI_DEVICE_COMPILE_EXTENSION_STRING_EXP "ur_exp_multi_device_compile"
9333-
#endif // UR_MULTI_DEVICE_COMPILE_EXTENSION_STRING_EXP
9334-
9335-
///////////////////////////////////////////////////////////////////////////////
9336-
/// @brief Produces an executable program from one program, negates need for the
9337-
/// linking step.
9338-
///
9339-
/// @details
9340-
/// - The application may call this function from simultaneous threads.
9341-
/// - Following a successful call to this entry point, the program passed
9342-
/// will contain a binary of the ::UR_PROGRAM_BINARY_TYPE_EXECUTABLE type
9343-
/// for each device in `phDevices`.
9344-
///
9345-
/// @remarks
9346-
/// _Analogues_
9347-
/// - **clBuildProgram**
9348-
///
9349-
/// @returns
9350-
/// - ::UR_RESULT_SUCCESS
9351-
/// - ::UR_RESULT_ERROR_UNINITIALIZED
9352-
/// - ::UR_RESULT_ERROR_DEVICE_LOST
9353-
/// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC
9354-
/// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE
9355-
/// + `NULL == hProgram`
9356-
/// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER
9357-
/// + `NULL == phDevices`
9358-
/// - ::UR_RESULT_ERROR_INVALID_PROGRAM
9359-
/// + If `hProgram` isn't a valid program object.
9360-
/// - ::UR_RESULT_ERROR_PROGRAM_BUILD_FAILURE
9361-
/// + If an error occurred when building `hProgram`.
9362-
UR_APIEXPORT ur_result_t UR_APICALL
9363-
urProgramBuildExp(
9364-
ur_program_handle_t hProgram, ///< [in] Handle of the program to build.
9365-
uint32_t numDevices, ///< [in] number of devices
9366-
ur_device_handle_t *phDevices, ///< [in][range(0, numDevices)] pointer to array of device handles
9367-
const char *pOptions ///< [in][optional] pointer to build options null-terminated string.
9368-
);
9369-
9370-
///////////////////////////////////////////////////////////////////////////////
9371-
/// @brief Produces an executable program from one or more programs.
9372-
///
9373-
/// @details
9374-
/// - The application may call this function from simultaneous threads.
9375-
/// - Following a successful call to this entry point `hProgram` will
9376-
/// contain a binary of the ::UR_PROGRAM_BINARY_TYPE_COMPILED_OBJECT type
9377-
/// for each device in `phDevices`.
9378-
///
9379-
/// @remarks
9380-
/// _Analogues_
9381-
/// - **clCompileProgram**
9382-
///
9383-
/// @returns
9384-
/// - ::UR_RESULT_SUCCESS
9385-
/// - ::UR_RESULT_ERROR_UNINITIALIZED
9386-
/// - ::UR_RESULT_ERROR_DEVICE_LOST
9387-
/// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC
9388-
/// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE
9389-
/// + `NULL == hProgram`
9390-
/// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER
9391-
/// + `NULL == phDevices`
9392-
/// - ::UR_RESULT_ERROR_INVALID_PROGRAM
9393-
/// + If `hProgram` isn't a valid program object.
9394-
/// - ::UR_RESULT_ERROR_PROGRAM_BUILD_FAILURE
9395-
/// + If an error occurred while compiling `hProgram`.
9396-
UR_APIEXPORT ur_result_t UR_APICALL
9397-
urProgramCompileExp(
9398-
ur_program_handle_t hProgram, ///< [in][out] handle of the program to compile.
9399-
uint32_t numDevices, ///< [in] number of devices
9400-
ur_device_handle_t *phDevices, ///< [in][range(0, numDevices)] pointer to array of device handles
9401-
const char *pOptions ///< [in][optional] pointer to build options null-terminated string.
9402-
);
9403-
9404-
///////////////////////////////////////////////////////////////////////////////
9405-
/// @brief Produces an executable program from one or more programs.
9406-
///
9407-
/// @details
9408-
/// - The application may call this function from simultaneous threads.
9409-
/// - Following a successful call to this entry point the program returned
9410-
/// in `phProgram` will contain a binary of the
9411-
/// ::UR_PROGRAM_BINARY_TYPE_EXECUTABLE type for each device in
9412-
/// `phDevices`.
9413-
/// - If a non-success code is returned and `phProgram` is not `nullptr`, it
9414-
/// will contain an unspecified program or `nullptr`. Implementations may
9415-
/// use the build log of this program (accessible via
9416-
/// ::urProgramGetBuildInfo) to provide an error log for the linking
9417-
/// failure.
9418-
///
9419-
/// @remarks
9420-
/// _Analogues_
9421-
/// - **clLinkProgram**
9422-
///
9423-
/// @returns
9424-
/// - ::UR_RESULT_SUCCESS
9425-
/// - ::UR_RESULT_ERROR_UNINITIALIZED
9426-
/// - ::UR_RESULT_ERROR_DEVICE_LOST
9427-
/// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC
9428-
/// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE
9429-
/// + `NULL == hContext`
9430-
/// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER
9431-
/// + `NULL == phDevices`
9432-
/// + `NULL == phPrograms`
9433-
/// + `NULL == phProgram`
9434-
/// - ::UR_RESULT_ERROR_INVALID_PROGRAM
9435-
/// + If one of the programs in `phPrograms` isn't a valid program object.
9436-
/// - ::UR_RESULT_ERROR_INVALID_SIZE
9437-
/// + `count == 0`
9438-
/// - ::UR_RESULT_ERROR_PROGRAM_LINK_FAILURE
9439-
/// + If an error occurred while linking `phPrograms`.
9440-
UR_APIEXPORT ur_result_t UR_APICALL
9441-
urProgramLinkExp(
9442-
ur_context_handle_t hContext, ///< [in] handle of the context instance.
9443-
uint32_t numDevices, ///< [in] number of devices
9444-
ur_device_handle_t *phDevices, ///< [in][range(0, numDevices)] pointer to array of device handles
9445-
uint32_t count, ///< [in] number of program handles in `phPrograms`.
9446-
const ur_program_handle_t *phPrograms, ///< [in][range(0, count)] pointer to array of program handles.
9447-
const char *pOptions, ///< [in][optional] pointer to linker options null-terminated string.
9448-
ur_program_handle_t *phProgram ///< [out] pointer to handle of program object created.
9449-
);
9450-
94519330
#if !defined(__GNUC__)
94529331
#pragma endregion
94539332
#endif
@@ -10045,68 +9924,36 @@ typedef struct ur_program_create_with_binary_params_t {
100459924
/// @details Each entry is a pointer to the parameter passed to the function;
100469925
/// allowing the callback the ability to modify the parameter's value
100479926
typedef struct ur_program_build_params_t {
10048-
ur_context_handle_t *phContext;
10049-
ur_program_handle_t *phProgram;
10050-
const char **ppOptions;
10051-
} ur_program_build_params_t;
10052-
10053-
///////////////////////////////////////////////////////////////////////////////
10054-
/// @brief Function parameters for urProgramBuildExp
10055-
/// @details Each entry is a pointer to the parameter passed to the function;
10056-
/// allowing the callback the ability to modify the parameter's value
10057-
typedef struct ur_program_build_exp_params_t {
100589927
ur_program_handle_t *phProgram;
100599928
uint32_t *pnumDevices;
100609929
ur_device_handle_t **pphDevices;
100619930
const char **ppOptions;
10062-
} ur_program_build_exp_params_t;
9931+
} ur_program_build_params_t;
100639932

100649933
///////////////////////////////////////////////////////////////////////////////
100659934
/// @brief Function parameters for urProgramCompile
100669935
/// @details Each entry is a pointer to the parameter passed to the function;
100679936
/// allowing the callback the ability to modify the parameter's value
100689937
typedef struct ur_program_compile_params_t {
10069-
ur_context_handle_t *phContext;
10070-
ur_program_handle_t *phProgram;
10071-
const char **ppOptions;
10072-
} ur_program_compile_params_t;
10073-
10074-
///////////////////////////////////////////////////////////////////////////////
10075-
/// @brief Function parameters for urProgramCompileExp
10076-
/// @details Each entry is a pointer to the parameter passed to the function;
10077-
/// allowing the callback the ability to modify the parameter's value
10078-
typedef struct ur_program_compile_exp_params_t {
100799938
ur_program_handle_t *phProgram;
100809939
uint32_t *pnumDevices;
100819940
ur_device_handle_t **pphDevices;
100829941
const char **ppOptions;
10083-
} ur_program_compile_exp_params_t;
9942+
} ur_program_compile_params_t;
100849943

100859944
///////////////////////////////////////////////////////////////////////////////
100869945
/// @brief Function parameters for urProgramLink
100879946
/// @details Each entry is a pointer to the parameter passed to the function;
100889947
/// allowing the callback the ability to modify the parameter's value
100899948
typedef struct ur_program_link_params_t {
10090-
ur_context_handle_t *phContext;
10091-
uint32_t *pcount;
10092-
const ur_program_handle_t **pphPrograms;
10093-
const char **ppOptions;
10094-
ur_program_handle_t **pphProgram;
10095-
} ur_program_link_params_t;
10096-
10097-
///////////////////////////////////////////////////////////////////////////////
10098-
/// @brief Function parameters for urProgramLinkExp
10099-
/// @details Each entry is a pointer to the parameter passed to the function;
10100-
/// allowing the callback the ability to modify the parameter's value
10101-
typedef struct ur_program_link_exp_params_t {
101029949
ur_context_handle_t *phContext;
101039950
uint32_t *pnumDevices;
101049951
ur_device_handle_t **pphDevices;
101059952
uint32_t *pcount;
101069953
const ur_program_handle_t **pphPrograms;
101079954
const char **ppOptions;
101089955
ur_program_handle_t **pphProgram;
10109-
} ur_program_link_exp_params_t;
9956+
} ur_program_link_params_t;
101109957

101119958
///////////////////////////////////////////////////////////////////////////////
101129959
/// @brief Function parameters for urProgramRetain

include/ur_api_funcs.def

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,6 @@ _UR_API(urProgramGetBuildInfo)
4949
_UR_API(urProgramSetSpecializationConstants)
5050
_UR_API(urProgramGetNativeHandle)
5151
_UR_API(urProgramCreateWithNativeHandle)
52-
_UR_API(urProgramBuildExp)
53-
_UR_API(urProgramCompileExp)
54-
_UR_API(urProgramLinkExp)
5552
_UR_API(urKernelCreate)
5653
_UR_API(urKernelGetInfo)
5754
_UR_API(urKernelGetGroupInfo)

0 commit comments

Comments
 (0)