26 inline namespace _V1 {
78 program_impl(std::vector<std::shared_ptr<program_impl>> ProgramList,
129 cl_program
get()
const;
139 bool is_host()
const {
return MContext->is_host(); }
204 std::shared_ptr<program_impl> PtrToSelf,
205 bool IsCreatedFromSource)
const;
221 return createSyclObjFromImpl<context>(MContext);
226 assert(!
is_host() &&
"Plugin is not available for Host.");
227 return MContext->getPlugin();
313 template <
typename Param>
314 void check_device_feature_support(
const std::vector<device> &Devices) {
315 for (
const auto &Device : Devices) {
316 if (!Device.get_info<Param>()) {
318 sycl::errc::feature_not_supported,
319 "Online compilation is not supported by this device");
331 create_pi_program_with_kernel_name(
const std::string &KernelName,
332 bool JITCompilationIsRequired =
false);
345 std::vector<sycl::detail::pi::PiDevice> get_pi_devices()
const;
349 static bool is_cacheable_with_options(
const std::string &Options) {
350 return Options.empty();
355 bool has_cl_kernel(
const std::string &KernelName)
const;
360 std::pair<sycl::detail::pi::PiKernel, const KernelArgMask *>
361 get_pi_kernel_arg_mask_pair(
const std::string &KernelName)
const;
364 std::vector<device> sort_devices_by_cl_device_id(std::vector<device> Devices);
382 bool MLinkable =
false;
383 std::vector<device> MDevices;
384 property_list MPropList;
398 bool MProgramAndKernelCachingAllowed =
false;
400 bool MIsInterop =
false;
The context class represents a SYCL context on which kernel functions may be executed.
void link(std::string LinkOptions="")
Links encapsulated raw program.
void compile_with_kernel_name(std::string KernelName, std::string CompileOptions)
Compiles the SYCL kernel function into the encapsulated raw program.
std::string get_build_options() const
Returns the compile, link, or build options, from whichever of those operations was performed most re...
const sycl::detail::pi::PiProgram & getHandleRef() const
bool hasSetSpecConstants() const
Tells whether a specialization constant has been set for this program.
context get_context() const
void stableSerializeSpecConstRegistry(SerializedObj &Dst) const
program_state get_state() const
ContextImplPtr getContextImplPtr() const
kernel get_kernel(std::string KernelName, std::shared_ptr< program_impl > PtrToSelf, bool IsCreatedFromSource) const
Returns a SYCL kernel for the SYCL kernel function defined by kernel name.
std::vector< std::vector< char > > get_binaries() const
Returns built program binaries.
std::vector< device > get_devices() const
std::string get_link_options() const
Returns compile options that were provided to the most recent invocation of link member function.
void flush_spec_constants(const RTDeviceBinaryImage &Img, sycl::detail::pi::PiProgram NativePrg=nullptr) const
Takes current values of specialization constants and "injects" them into the underlying native progra...
bool has_property() const
Checks if this program_impl has a property of type propertyT.
const PluginPtr & getPlugin() const
std::string get_compile_options() const
Returns compile options that were provided when the encapsulated program was explicitly compiled.
pi_native_handle getNative() const
Returns the native plugin handle.
void build_with_kernel_name(std::string KernelName, std::string BuildOptions)
Builds the SYCL kernel function into encapsulated raw program.
cl_program get() const
Returns a valid cl_program instance.
bool has_kernel(std::string KernelName, bool IsCreatedFromSource) const
Checks if kernel is available for this program.
sycl::detail::pi::PiProgram & getHandleRef()
bool is_cacheable() const
propertyT get_property() const
Gets the specified property of this program_impl.
Provides an abstraction of a SYCL kernel.
Objects of the property_list class are containers for the SYCL properties.
bool has_property() const noexcept
PropT get_property() const
std::map< std::string, spec_constant_impl > SpecConstRegistryT
void stableSerializeSpecConstRegistry(const SpecConstRegistryT &Reg, SerializedObj &Dst)
std::shared_ptr< sycl::detail::context_impl > ContextImplPtr
std::shared_ptr< plugin > PluginPtr
std::vector< unsigned char > SerializedObj
uintptr_t pi_native_handle