DPC++ Runtime
Runtime libraries for oneAPI DPC++
cl::sycl::ext::intel::experimental::online_compiler< Lang > Class Template Reference

Represents an online compiler for the language given as template parameter. More...

#include <sycl/ext/intel/experimental/online_compiler.hpp>

Public Member Functions

 online_compiler (compiled_code_format fmt=compiled_code_format::spir_v)
 Constructs online compiler which can target any device and produces given compiled code format. More...
 
 online_compiler (sycl::info::device_type dev_type, device_arch arch, compiled_code_format fmt=compiled_code_format::spir_v)
 Constructs online compiler which targets given architecture and produces given compiled code format. More...
 
 online_compiler (const sycl::device &)
 Constructs online compiler for the target specified by given SYCL device. More...
 
template<typename... Tys>
std::vector< bytecompile (const std::string &src, const Tys &... args)
 Compiles given in-memory Lang source to a binary blob. More...
 
online_compiler< Lang > & setOutputFormat (compiled_code_format fmt)
 Sets the compiled code format of the compilation target and returns *this. More...
 
online_compiler< Lang > & setOutputFormatVersion (int major, int minor)
 Sets the compiled code format version of the compilation target and returns *this. More...
 
online_compiler< Lang > & setTargetDeviceType (sycl::info::device_type type)
 Sets the device type of the compilation target and returns *this. More...
 
online_compiler< Lang > & setTargetDeviceArch (device_arch arch)
 Sets the device architecture of the compilation target and returns *this. More...
 
online_compiler< Lang > & set32bitTarget ()
 Makes the compilation target 32-bit and returns *this. More...
 
online_compiler< Lang > & set64bitTarget ()
 Makes the compilation target 64-bit and returns *this. More...
 
online_compiler< Lang > & setTargetDeviceStepping (const std::string &id)
 Sets implementation-defined target device stepping of the compilation target and returns *this. More...
 
std::vector< bytecompile (const std::string &src, const std::vector< std::string > &options)
 Compiles the given OpenCL source. More...
 
std::vector< bytecompile (const std::string &src)
 Compiles the given OpenCL source. More...
 
std::vector< bytecompile (const std::string &src, const std::vector< std::string > &options)
 Compiles the given CM source src. More...
 
std::vector< bytecompile (const std::string &src)
 Compiles the given CM source src. More...
 
std::vector< bytecompile (const std::string &Source, const std::vector< std::string > &UserArgs)
 
std::vector< bytecompile (const std::string &Source, const std::vector< std::string > &UserArgs)
 

Detailed Description

template<source_language Lang>
class cl::sycl::ext::intel::experimental::online_compiler< Lang >

Represents an online compiler for the language given as template parameter.

Definition at line 74 of file online_compiler.hpp.

Constructor & Destructor Documentation

◆ online_compiler() [1/3]

Constructs online compiler which can target any device and produces given compiled code format.

Produces 64-bit device code. The created compiler is "optimistic" - it assumes all applicable SYCL device capabilities are supported by the target device(s).

Definition at line 80 of file online_compiler.hpp.

◆ online_compiler() [2/3]

Constructs online compiler which targets given architecture and produces given compiled code format.

Produces 64-bit device code. Throws online_compile_error if values of constructor arguments are contradictory or not supported - e.g. if the source language is not supported for given device type.

Definition at line 90 of file online_compiler.hpp.

◆ online_compiler() [3/3]

template<source_language Lang>
cl::sycl::ext::intel::experimental::online_compiler< Lang >::online_compiler ( const sycl::device )
inline

Constructs online compiler for the target specified by given SYCL device.

Definition at line 99 of file online_compiler.hpp.

References cl::sycl::ext::intel::experimental::spir_v.

Member Function Documentation

◆ compile() [1/7]

std::vector< byte > cl::sycl::ext::intel::experimental::online_compiler< source_language::opencl_c >::compile ( const std::string &  Source,
const std::vector< std::string > &  UserArgs 
)

◆ compile() [2/7]

std::vector< byte > cl::sycl::ext::intel::experimental::online_compiler< source_language::cm >::compile ( const std::string &  Source,
const std::vector< std::string > &  UserArgs 
)

◆ compile() [3/7]

std::vector< byte > cl::sycl::ext::intel::experimental::online_compiler< source_language::opencl_c >::compile ( const std::string &  src)

Compiles the given OpenCL source.

May throw online_compile_error.

Parameters
src- contents of the source.

Definition at line 199 of file online_compiler.hpp.

References cl::sycl::compile().

◆ compile() [4/7]

std::vector< byte > cl::sycl::ext::intel::experimental::online_compiler< source_language::cm >::compile ( const std::string &  src)

Compiles the given CM source src.

Definition at line 215 of file online_compiler.hpp.

References cl::sycl::compile().

◆ compile() [5/7]

std::vector< byte > cl::sycl::ext::intel::experimental::online_compiler< source_language::opencl_c >::compile ( const std::string &  src,
const std::vector< std::string > &  options 
)

Compiles the given OpenCL source.

May throw online_compile_error.

Parameters
src- contents of the source.
options- compilation options (implementation defined); standard OpenCL JIT compiler options must be supported.

◆ compile() [6/7]

std::vector< byte > cl::sycl::ext::intel::experimental::online_compiler< source_language::cm >::compile ( const std::string &  src,
const std::vector< std::string > &  options 
)

Compiles the given CM source src.

Parameters
src- contents of the source.
options- compilation options (implementation defined).

◆ compile() [7/7]

template<source_language Lang>
template<typename... Tys>
std::vector<byte> cl::sycl::ext::intel::experimental::online_compiler< Lang >::compile ( const std::string &  src,
const Tys &...  args 
)

Compiles given in-memory Lang source to a binary blob.

Blob format, other parameters are set in the constructor by the compilation target specification parameters. Specialization for each language will provide exact signatures, which can be different for different languages. Throws online_compile_error if compilation is not successful.

◆ set32bitTarget()

template<source_language Lang>
online_compiler<Lang>& cl::sycl::ext::intel::experimental::online_compiler< Lang >::set32bitTarget ( )
inline

Makes the compilation target 32-bit and returns *this.

Definition at line 139 of file online_compiler.hpp.

◆ set64bitTarget()

template<source_language Lang>
online_compiler<Lang>& cl::sycl::ext::intel::experimental::online_compiler< Lang >::set64bitTarget ( )
inline

Makes the compilation target 64-bit and returns *this.

Definition at line 145 of file online_compiler.hpp.

◆ setOutputFormat()

template<source_language Lang>
online_compiler<Lang>& cl::sycl::ext::intel::experimental::online_compiler< Lang >::setOutputFormat ( compiled_code_format  fmt)
inline

Sets the compiled code format of the compilation target and returns *this.

Definition at line 114 of file online_compiler.hpp.

◆ setOutputFormatVersion()

template<source_language Lang>
online_compiler<Lang>& cl::sycl::ext::intel::experimental::online_compiler< Lang >::setOutputFormatVersion ( int  major,
int  minor 
)
inline

Sets the compiled code format version of the compilation target and returns *this.

Definition at line 121 of file online_compiler.hpp.

◆ setTargetDeviceArch()

template<source_language Lang>
online_compiler<Lang>& cl::sycl::ext::intel::experimental::online_compiler< Lang >::setTargetDeviceArch ( device_arch  arch)
inline

Sets the device architecture of the compilation target and returns *this.

Definition at line 133 of file online_compiler.hpp.

◆ setTargetDeviceStepping()

template<source_language Lang>
online_compiler<Lang>& cl::sycl::ext::intel::experimental::online_compiler< Lang >::setTargetDeviceStepping ( const std::string &  id)
inline

Sets implementation-defined target device stepping of the compilation target and returns *this.

Definition at line 152 of file online_compiler.hpp.

◆ setTargetDeviceType()

template<source_language Lang>
online_compiler<Lang>& cl::sycl::ext::intel::experimental::online_compiler< Lang >::setTargetDeviceType ( sycl::info::device_type  type)
inline

Sets the device type of the compilation target and returns *this.

Definition at line 127 of file online_compiler.hpp.


The documentation for this class was generated from the following file: