DPC++ Runtime
Runtime libraries for oneAPI DPC++
|
|
Go to the documentation of this file.
27 ByteArray(
const std::uint8_t *Ptr, std::size_t Size) : Ptr{Ptr}, Size{Size} {}
28 const std::uint8_t &
operator[](std::size_t Idx)
const {
return Ptr[Idx]; }
29 std::size_t
size()
const {
return Size; }
33 template <
typename... Ts>
auto consume() {
34 if constexpr (
sizeof...(Ts) == 1)
35 return consumeOneElem<Ts...>();
37 return std::tuple{consumeOneElem<Ts>()...};
41 assert(Bytes <= Size &&
"Not enough bytes left!");
46 template <
typename T>
void drop() {
return dropBytes(
sizeof(T)); }
48 bool empty()
const {
return Size == 0; }
51 template <
typename T> T consumeOneElem() {
52 assert(
sizeof(T) <= Size &&
"Out of bounds!");
59 const std::uint8_t *Ptr;
71 const char *asCString()
const;
74 friend std::ostream &
operator<<(std::ostream &Out,
88 using ValTy = std::remove_pointer<pi_device_binary_property>::type;
116 size_t size()
const {
return std::distance(begin(), end()); }
127 init(Bin, PropSetName);
136 : Bin(nullptr), ModuleHandle(ModuleHandle) {}
138 : ModuleHandle(ModuleHandle) {
159 virtual void print()
const;
160 virtual void dump(std::ostream &Out)
const;
163 assert(Bin &&
"binary image data not set");
164 return static_cast<size_t>(Bin->BinaryEnd - Bin->BinaryStart);
168 assert(Bin &&
"binary image data not set");
169 return Bin->CompileOptions;
173 assert(Bin &&
"binary image data not set");
174 return Bin->LinkOptions;
179 assert(Bin &&
"binary image data not set");
212 return SpecConstDefaultValuesMap;
216 return KernelParamOptInfo;
223 return DeviceRequirements;
227 assert(Bin &&
"Image ID is not available without a binary image.");
228 return reinterpret_cast<std::uintptr_t
>(Bin);
static constexpr pi_device_binary_type PI_DEVICE_BINARY_TYPE_NONE
RTDeviceBinaryImage::PropertyRange ExportedSymbols
RTDeviceBinaryImage::PropertyRange DeviceGlobals
const PropertyRange & getKernelParamOptInfo() const
::pi_device_binary_type PiDeviceBinaryType
const pi_device_binary_struct & getRawData() const
static constexpr pi_device_binary_type PI_DEVICE_BINARY_TYPE_SPIRV
OSModuleHandle ModuleHandle
const PropertyRange & getDeviceLibReqMask() const
#define __SYCL_INLINE_VER_NAMESPACE(X)
RTDeviceBinaryImage::PropertyRange AssertUsed
const PropertyRange & getSpecConstantsDefaultValues() const
const std::uint8_t & operator[](std::size_t Idx) const
const _pi_device_binary_property_struct * Prop
const PropertyRange & getAssertUsed() const
void memcpy(void *Dst, const void *Src, size_t Size)
const PropertyRange & getDeviceRequirements() const
ConstIterator begin() const
OSModuleHandle getOSModuleHandle() const
---— Error handling, matching OpenCL plugin semantics.
ConstIterator operator++(int)
std::input_iterator_tag iterator_category
ptrdiff_t difference_type
const char * getLinkOptions() const
const PropertyRange & getDeviceGlobals() const
constexpr tuple_element< I, tuple< Types... > >::type & get(sycl::detail::tuple< Types... > &Arg) noexcept
RTDeviceBinaryImage::PropertyRange DeviceRequirements
RTDeviceBinaryImage::PropertyRange DeviceLibReqMask
bool supportsSpecConstants() const
ConstIterator end() const
This struct is a record of the device binary information.
RTDeviceBinaryImage::PropertyRange ProgramMetadata
annotated_arg & operator=(annotated_arg &)=default
ConstIterator(pi_device_binary_property Cur=nullptr)
bool operator==(ConstIterator Other) const
const char * getCompileOptions() const
__SYCL_EXTERN_STREAM_ATTRS ostream cerr
Linked to standard error (unbuffered)
void print() const override
RTDeviceBinaryImage::PropertyRange SpecConstDefaultValuesMap
RTDeviceBinaryImage::PropertyRange KernelParamOptInfo
std::enable_if<!std::is_pointer< T >::value, void >::type print(T val)
const PropertyRange & getExportedSymbols() const
intptr_t OSModuleHandle
Uniquely identifies an operating system module (executable or a dynamic library)
const PropertyRange & getProgramMetadata() const
ConstIterator begin() const
const PropertyRange & getSpecConstants() const
Gets the iterator range over specialization constants in this binary image.
RTDeviceBinaryImage::PropertyRange SpecConstIDMap
reference operator*() const
ByteArray(const std::uint8_t *Ptr, std::size_t Size)
ConstIterator end() const
std::uintptr_t getImageID() const
std::remove_pointer< pi_device_binary_property >::type ValTy
void dropBytes(std::size_t Bytes)
_pi_device_binary_property_struct * pi_device_binary_property
ConstIterator & operator++()
RTDeviceBinaryImage(pi_device_binary Bin, OSModuleHandle ModuleHandle)
const std::uint8_t * ConstIterator
std::ostream & operator<<(std::ostream &Out, backend be)
virtual ~RTDeviceBinaryImage()
bool operator!=(ConstIterator Other) const
RTDeviceBinaryImage(OSModuleHandle ModuleHandle)
pi_device_binary get() const
pi::PiDeviceBinaryType getFormat() const
Returns the format of the binary image.
std::unique_ptr< char[]> Data
DeviceBinaryProperty(const _pi_device_binary_property_struct *Prop)