Skip to content

Commit e7c96d0

Browse files
committed
Merge changes from multi device compile extension into core spec.
1 parent 2ad3268 commit e7c96d0

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
@@ -4262,17 +4259,21 @@ urProgramCreateWithBinary(
42624259
/// - ::UR_RESULT_ERROR_DEVICE_LOST
42634260
/// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC
42644261
/// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE
4265-
/// + `NULL == hContext`
42664262
/// + `NULL == hProgram`
4263+
/// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER
4264+
/// + `NULL == phDevices`
42674265
/// - ::UR_RESULT_ERROR_INVALID_PROGRAM
42684266
/// + If `hProgram` isn't a valid program object.
42694267
/// - ::UR_RESULT_ERROR_PROGRAM_BUILD_FAILURE
42704268
/// + If an error occurred when building `hProgram`.
4269+
/// - ::UR_RESULT_ERROR_INVALID_SIZE
4270+
/// + `numDevices == 0`
42714271
UR_APIEXPORT ur_result_t UR_APICALL
42724272
urProgramBuild(
4273-
ur_context_handle_t hContext, ///< [in] handle of the context instance.
4274-
ur_program_handle_t hProgram, ///< [in] Handle of the program to build.
4275-
const char *pOptions ///< [in][optional] pointer to build options null-terminated string.
4273+
ur_program_handle_t hProgram, ///< [in] Handle of the program to build.
4274+
uint32_t numDevices, ///< [in] length of `phDevices`
4275+
ur_device_handle_t *phDevices, ///< [in][range(0, numDevices)] pointer to array of device handles
4276+
const char *pOptions ///< [in][optional] pointer to build options null-terminated string.
42764277
);
42774278

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

43104315
///////////////////////////////////////////////////////////////////////////////
@@ -4334,17 +4339,21 @@ urProgramCompile(
43344339
/// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE
43354340
/// + `NULL == hContext`
43364341
/// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER
4342+
/// + `NULL == phDevices`
43374343
/// + `NULL == phPrograms`
43384344
/// + `NULL == phProgram`
43394345
/// - ::UR_RESULT_ERROR_INVALID_PROGRAM
43404346
/// + If one of the programs in `phPrograms` isn't a valid program object.
43414347
/// - ::UR_RESULT_ERROR_INVALID_SIZE
4348+
/// + `numDevices == 0`
43424349
/// + `count == 0`
43434350
/// - ::UR_RESULT_ERROR_PROGRAM_LINK_FAILURE
43444351
/// + If an error occurred while linking `phPrograms`.
43454352
UR_APIEXPORT ur_result_t UR_APICALL
43464353
urProgramLink(
43474354
ur_context_handle_t hContext, ///< [in] handle of the context instance.
4355+
uint32_t numDevices, ///< [in] number of devices
4356+
ur_device_handle_t *phDevices, ///< [in][range(0, numDevices)] pointer to array of device handles
43484357
uint32_t count, ///< [in] number of program handles in `phPrograms`.
43494358
const ur_program_handle_t *phPrograms, ///< [in][range(0, count)] pointer to array of program handles.
43504359
const char *pOptions, ///< [in][optional] pointer to linker options null-terminated string.
@@ -9270,136 +9279,6 @@ urEnqueueKernelLaunchCustomExp(
92709279
///< kernel execution instance.
92719280
);
92729281

9273-
#if !defined(__GNUC__)
9274-
#pragma endregion
9275-
#endif
9276-
// Intel 'oneAPI' Unified Runtime Experimental APIs for multi-device compile
9277-
#if !defined(__GNUC__)
9278-
#pragma region multi_device_compile_(experimental)
9279-
#endif
9280-
///////////////////////////////////////////////////////////////////////////////
9281-
#ifndef UR_MULTI_DEVICE_COMPILE_EXTENSION_STRING_EXP
9282-
/// @brief The extension string which defines support for test
9283-
/// which is returned when querying device extensions.
9284-
#define UR_MULTI_DEVICE_COMPILE_EXTENSION_STRING_EXP "ur_exp_multi_device_compile"
9285-
#endif // UR_MULTI_DEVICE_COMPILE_EXTENSION_STRING_EXP
9286-
9287-
///////////////////////////////////////////////////////////////////////////////
9288-
/// @brief Produces an executable program from one program, negates need for the
9289-
/// linking step.
9290-
///
9291-
/// @details
9292-
/// - The application may call this function from simultaneous threads.
9293-
/// - Following a successful call to this entry point, the program passed
9294-
/// will contain a binary of the ::UR_PROGRAM_BINARY_TYPE_EXECUTABLE type
9295-
/// for each device in `phDevices`.
9296-
///
9297-
/// @remarks
9298-
/// _Analogues_
9299-
/// - **clBuildProgram**
9300-
///
9301-
/// @returns
9302-
/// - ::UR_RESULT_SUCCESS
9303-
/// - ::UR_RESULT_ERROR_UNINITIALIZED
9304-
/// - ::UR_RESULT_ERROR_DEVICE_LOST
9305-
/// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC
9306-
/// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE
9307-
/// + `NULL == hProgram`
9308-
/// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER
9309-
/// + `NULL == phDevices`
9310-
/// - ::UR_RESULT_ERROR_INVALID_PROGRAM
9311-
/// + If `hProgram` isn't a valid program object.
9312-
/// - ::UR_RESULT_ERROR_PROGRAM_BUILD_FAILURE
9313-
/// + If an error occurred when building `hProgram`.
9314-
UR_APIEXPORT ur_result_t UR_APICALL
9315-
urProgramBuildExp(
9316-
ur_program_handle_t hProgram, ///< [in] Handle of the program to build.
9317-
uint32_t numDevices, ///< [in] number of devices
9318-
ur_device_handle_t *phDevices, ///< [in][range(0, numDevices)] pointer to array of device handles
9319-
const char *pOptions ///< [in][optional] pointer to build options null-terminated string.
9320-
);
9321-
9322-
///////////////////////////////////////////////////////////////////////////////
9323-
/// @brief Produces an executable program from one or more programs.
9324-
///
9325-
/// @details
9326-
/// - The application may call this function from simultaneous threads.
9327-
/// - Following a successful call to this entry point `hProgram` will
9328-
/// contain a binary of the ::UR_PROGRAM_BINARY_TYPE_COMPILED_OBJECT type
9329-
/// for each device in `phDevices`.
9330-
///
9331-
/// @remarks
9332-
/// _Analogues_
9333-
/// - **clCompileProgram**
9334-
///
9335-
/// @returns
9336-
/// - ::UR_RESULT_SUCCESS
9337-
/// - ::UR_RESULT_ERROR_UNINITIALIZED
9338-
/// - ::UR_RESULT_ERROR_DEVICE_LOST
9339-
/// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC
9340-
/// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE
9341-
/// + `NULL == hProgram`
9342-
/// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER
9343-
/// + `NULL == phDevices`
9344-
/// - ::UR_RESULT_ERROR_INVALID_PROGRAM
9345-
/// + If `hProgram` isn't a valid program object.
9346-
/// - ::UR_RESULT_ERROR_PROGRAM_BUILD_FAILURE
9347-
/// + If an error occurred while compiling `hProgram`.
9348-
UR_APIEXPORT ur_result_t UR_APICALL
9349-
urProgramCompileExp(
9350-
ur_program_handle_t hProgram, ///< [in][out] handle of the program to compile.
9351-
uint32_t numDevices, ///< [in] number of devices
9352-
ur_device_handle_t *phDevices, ///< [in][range(0, numDevices)] pointer to array of device handles
9353-
const char *pOptions ///< [in][optional] pointer to build options null-terminated string.
9354-
);
9355-
9356-
///////////////////////////////////////////////////////////////////////////////
9357-
/// @brief Produces an executable program from one or more programs.
9358-
///
9359-
/// @details
9360-
/// - The application may call this function from simultaneous threads.
9361-
/// - Following a successful call to this entry point the program returned
9362-
/// in `phProgram` will contain a binary of the
9363-
/// ::UR_PROGRAM_BINARY_TYPE_EXECUTABLE type for each device in
9364-
/// `phDevices`.
9365-
/// - If a non-success code is returned and `phProgram` is not `nullptr`, it
9366-
/// will contain an unspecified program or `nullptr`. Implementations may
9367-
/// use the build log of this program (accessible via
9368-
/// ::urProgramGetBuildInfo) to provide an error log for the linking
9369-
/// failure.
9370-
///
9371-
/// @remarks
9372-
/// _Analogues_
9373-
/// - **clLinkProgram**
9374-
///
9375-
/// @returns
9376-
/// - ::UR_RESULT_SUCCESS
9377-
/// - ::UR_RESULT_ERROR_UNINITIALIZED
9378-
/// - ::UR_RESULT_ERROR_DEVICE_LOST
9379-
/// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC
9380-
/// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE
9381-
/// + `NULL == hContext`
9382-
/// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER
9383-
/// + `NULL == phDevices`
9384-
/// + `NULL == phPrograms`
9385-
/// + `NULL == phProgram`
9386-
/// - ::UR_RESULT_ERROR_INVALID_PROGRAM
9387-
/// + If one of the programs in `phPrograms` isn't a valid program object.
9388-
/// - ::UR_RESULT_ERROR_INVALID_SIZE
9389-
/// + `count == 0`
9390-
/// - ::UR_RESULT_ERROR_PROGRAM_LINK_FAILURE
9391-
/// + If an error occurred while linking `phPrograms`.
9392-
UR_APIEXPORT ur_result_t UR_APICALL
9393-
urProgramLinkExp(
9394-
ur_context_handle_t hContext, ///< [in] handle of the context instance.
9395-
uint32_t numDevices, ///< [in] number of devices
9396-
ur_device_handle_t *phDevices, ///< [in][range(0, numDevices)] pointer to array of device handles
9397-
uint32_t count, ///< [in] number of program handles in `phPrograms`.
9398-
const ur_program_handle_t *phPrograms, ///< [in][range(0, count)] pointer to array of program handles.
9399-
const char *pOptions, ///< [in][optional] pointer to linker options null-terminated string.
9400-
ur_program_handle_t *phProgram ///< [out] pointer to handle of program object created.
9401-
);
9402-
94039282
#if !defined(__GNUC__)
94049283
#pragma endregion
94059284
#endif
@@ -9997,68 +9876,36 @@ typedef struct ur_program_create_with_binary_params_t {
99979876
/// @details Each entry is a pointer to the parameter passed to the function;
99989877
/// allowing the callback the ability to modify the parameter's value
99999878
typedef struct ur_program_build_params_t {
10000-
ur_context_handle_t *phContext;
10001-
ur_program_handle_t *phProgram;
10002-
const char **ppOptions;
10003-
} ur_program_build_params_t;
10004-
10005-
///////////////////////////////////////////////////////////////////////////////
10006-
/// @brief Function parameters for urProgramBuildExp
10007-
/// @details Each entry is a pointer to the parameter passed to the function;
10008-
/// allowing the callback the ability to modify the parameter's value
10009-
typedef struct ur_program_build_exp_params_t {
100109879
ur_program_handle_t *phProgram;
100119880
uint32_t *pnumDevices;
100129881
ur_device_handle_t **pphDevices;
100139882
const char **ppOptions;
10014-
} ur_program_build_exp_params_t;
9883+
} ur_program_build_params_t;
100159884

100169885
///////////////////////////////////////////////////////////////////////////////
100179886
/// @brief Function parameters for urProgramCompile
100189887
/// @details Each entry is a pointer to the parameter passed to the function;
100199888
/// allowing the callback the ability to modify the parameter's value
100209889
typedef struct ur_program_compile_params_t {
10021-
ur_context_handle_t *phContext;
10022-
ur_program_handle_t *phProgram;
10023-
const char **ppOptions;
10024-
} ur_program_compile_params_t;
10025-
10026-
///////////////////////////////////////////////////////////////////////////////
10027-
/// @brief Function parameters for urProgramCompileExp
10028-
/// @details Each entry is a pointer to the parameter passed to the function;
10029-
/// allowing the callback the ability to modify the parameter's value
10030-
typedef struct ur_program_compile_exp_params_t {
100319890
ur_program_handle_t *phProgram;
100329891
uint32_t *pnumDevices;
100339892
ur_device_handle_t **pphDevices;
100349893
const char **ppOptions;
10035-
} ur_program_compile_exp_params_t;
9894+
} ur_program_compile_params_t;
100369895

100379896
///////////////////////////////////////////////////////////////////////////////
100389897
/// @brief Function parameters for urProgramLink
100399898
/// @details Each entry is a pointer to the parameter passed to the function;
100409899
/// allowing the callback the ability to modify the parameter's value
100419900
typedef struct ur_program_link_params_t {
10042-
ur_context_handle_t *phContext;
10043-
uint32_t *pcount;
10044-
const ur_program_handle_t **pphPrograms;
10045-
const char **ppOptions;
10046-
ur_program_handle_t **pphProgram;
10047-
} ur_program_link_params_t;
10048-
10049-
///////////////////////////////////////////////////////////////////////////////
10050-
/// @brief Function parameters for urProgramLinkExp
10051-
/// @details Each entry is a pointer to the parameter passed to the function;
10052-
/// allowing the callback the ability to modify the parameter's value
10053-
typedef struct ur_program_link_exp_params_t {
100549901
ur_context_handle_t *phContext;
100559902
uint32_t *pnumDevices;
100569903
ur_device_handle_t **pphDevices;
100579904
uint32_t *pcount;
100589905
const ur_program_handle_t **pphPrograms;
100599906
const char **ppOptions;
100609907
ur_program_handle_t **pphProgram;
10061-
} ur_program_link_exp_params_t;
9908+
} ur_program_link_params_t;
100629909

100639910
///////////////////////////////////////////////////////////////////////////////
100649911
/// @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)