Skip to content

Commit af43149

Browse files
authored
[SYCL][AOT] Enhance opencl-aot to compile or link program (#3104)
This patch implements 3 invocation types: opencl-aot -device= -cmd=link -spv=<spirv_input> -ir=<output_aocx> This compiles a SPIR-V program to an aocx (i.e. the standard ELF file from opencl_rt compiles) opencl-aot -device= -cmd=link -binary=<comma_separated_list_of_binary_filename> -ir=<output_aocx> This links LLVM IR and object files to generate an aocx opencl-aot -device= -cmd=compile -input=<opencl_input_file> -ir=<output_aocx> This compiles OpenCL source to an aocx
1 parent 4ad9e79 commit af43149

File tree

3 files changed

+201
-56
lines changed

3 files changed

+201
-56
lines changed

opencl-aot/include/utils.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ enum Errors : int8_t {
2828
OPENCL_AOT_FAILED_TO_CREATE_OPENCL_PROGRAM,
2929
OPENCL_AOT_FAILED_TO_CREATE_ELF,
3030
OPENCL_AOT_DEVICE_INFO_PARAMETER_IS_EMPTY,
31-
OPENCL_AOT_LIST_OF_INPUT_BINARIES_IS_EMPTY,
31+
OPENCL_AOT_LIST_OF_INPUT_FILES_IS_EMPTY,
3232
OPENCL_AOT_FAILED_TO_OPEN_FILE,
3333
OPENCL_AOT_FILE_IS_EMPTY,
3434
OPENCL_AOT_DEVICE_DOESNT_SUPPORT_SPIRV,
@@ -93,8 +93,12 @@ createProgramWithIL(std::vector<char> IL, cl_context Context,
9393
std::tuple<std::vector<char>, std::string, cl_int>
9494
readBinaryFile(std::string FileName);
9595

96+
bool isFileOCLSource(const std::string &FileName);
97+
9698
bool isFileELF(const std::vector<char> &BinaryData);
9799

98100
bool isFileSPIRV(const std::vector<char> &BinaryData);
99101

100-
#endif /* AOT_COMP_TOOL_UTILS */
102+
bool isFileLLVMIR(const std::vector<char> &BinaryData);
103+
104+
#endif /* AOT_COMP_TOOL_UTILS */

0 commit comments

Comments
 (0)