Skip to content

Commit b781398

Browse files
committed
Add new function definition to exp-multi-device-compile extension
1 parent 2296205 commit b781398

File tree

2 files changed

+53
-5
lines changed

2 files changed

+53
-5
lines changed

scripts/core/EXP-MULTI-DEVICE-COMPILE.rst

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,19 @@ Functions
3838
* ${x}ProgramBuildExp
3939
* ${x}ProgramCompileExp
4040
* ${x}ProgramLinkExp
41+
* ${x}ProgramCreateWithBinaryExp
4142

4243
Changelog
4344
--------------------------------------------------------------------------------
4445

45-
+-----------+------------------------+
46-
| Revision | Changes |
47-
+===========+========================+
48-
| 1.0 | Initial Draft |
49-
+-----------+------------------------+
46+
+-----------+-----------------------------------------------+
47+
| Revision | Changes |
48+
+===========+===============================================+
49+
| 1.0 | Initial Draft |
50+
+-----------+-----------------------------------------------+
51+
| 1.1 | Add function definition for program creation |
52+
| | from multiple device binaries |
53+
+-----------+-----------------------------------------------+
5054

5155
Support
5256
--------------------------------------------------------------------------------

scripts/core/exp-multi-device-compile.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,3 +124,47 @@ returns:
124124
- "`count == 0`"
125125
- $X_RESULT_ERROR_PROGRAM_LINK_FAILURE:
126126
- "If an error occurred while linking `phPrograms`."
127+
128+
--- #--------------------------------------------------------------------------
129+
type: function
130+
desc: "Create a program object from native binaries for the specified devices."
131+
class: $xProgram
132+
name: CreateWithBinaryExp
133+
decl: static
134+
ordinal: "5"
135+
analogue:
136+
- "**clCreateProgramWithBinary**"
137+
details:
138+
- "The application may call this function from simultaneous threads."
139+
- "Following a successful call to this entry point, `phProgram` will contain binaries of type $X_PROGRAM_BINARY_TYPE_COMPILED_OBJECT or $X_PROGRAM_BINARY_TYPE_LIBRARY for the specified devices in `phDevices`."
140+
- "The devices specified by `phDevices` must be associated with the context."
141+
- "The adapter may (but is not required to) perform validation of the provided modules during this call."
142+
params:
143+
- type: $x_context_handle_t
144+
name: hContext
145+
desc: "[in] handle of the context instance"
146+
- type: uint32_t
147+
name: numDevices
148+
desc: "[in] number of devices"
149+
- type: $x_device_handle_t*
150+
name: phDevices
151+
desc: "[in][range(0, numDevices)] a pointer to a list of device handles. The binaries are loaded for devices specified in this list."
152+
- type: size_t*
153+
name: pLengths
154+
desc: "[in][range(0, numDevices)] array of sizes of program binaries specified by `pBinaries` (in bytes)."
155+
- type: const uint8_t**
156+
name: ppBinaries
157+
desc: "[in][range(0, numDevices)] pointer to program binaries to be loaded for devices specified by `phDevices`."
158+
- type: const $x_program_properties_t*
159+
name: pProperties
160+
desc: "[in][optional] pointer to program creation properties."
161+
- type: $x_program_handle_t*
162+
name: phProgram
163+
desc: "[out] pointer to handle of Program object created."
164+
returns:
165+
- $X_RESULT_ERROR_INVALID_NULL_POINTER:
166+
- "`NULL != pProperties && pProperties->count > 0 && NULL == pProperties->pMetadatas`"
167+
- $X_RESULT_ERROR_INVALID_SIZE:
168+
- "`NULL != pProperties && NULL != pProperties->pMetadatas && pProperties->count == 0`"
169+
- $X_RESULT_ERROR_INVALID_NATIVE_BINARY:
170+
- "If any binary in `ppBinaries` isn't a valid binary for the corresponding device in `phDevices.`"

0 commit comments

Comments
 (0)