DPC++ Runtime
Runtime libraries for oneAPI DPC++
cl::sycl::detail::OSUtil Class Reference

Groups the OS-dependent services. More...

#include <CL/sycl/detail/os_util.hpp>

Collaboration diagram for cl::sycl::detail::OSUtil:

Static Public Member Functions

static OSModuleHandle getOSModuleHandle (const void *VirtAddr)
 Returns a module enclosing given address or nullptr. More...
 
static std::string getCurrentDSODir ()
 Returns an absolute path to a directory where the object was found. More...
 
static std::string getDirName (const char *Path)
 Returns a directory component of a path. More...
 
static size_t getOSMemSize ()
 Returns the amount of RAM available for the operating system. More...
 
static void * alignedAlloc (size_t Alignment, size_t NumBytes)
 Allocates NumBytes bytes of uninitialized storage whose alignment is specified by Alignment. More...
 
static void alignedFree (void *Ptr)
 Deallocates the memory referenced by Ptr. More...
 
static int makeDir (const char *Dir)
 Make directory recursively and returns zero code on success. More...
 
static bool isPathPresent (const std::string &Path)
 Checks if specified path is present. More...
 

Static Public Attributes

static constexpr OSModuleHandle ExeModuleHandle = -1
 Module handle for the executable module - it is assumed there is always single one at most. More...
 
static constexpr OSModuleHandle DummyModuleHandle = -2
 Dummy module handle to designate non-existing module for a device binary image loaded from file e.g. More...
 
static constexpr const charDirSep = "/"
 

Detailed Description

Groups the OS-dependent services.

Definition at line 51 of file os_util.hpp.

Member Function Documentation

◆ alignedAlloc()

void * cl::sycl::detail::OSUtil::alignedAlloc ( size_t  Alignment,
size_t  NumBytes 
)
static

Allocates NumBytes bytes of uninitialized storage whose alignment is specified by Alignment.

Definition at line 255 of file os_util.cpp.

References cl::sycl::aligned_alloc().

◆ alignedFree()

void cl::sycl::detail::OSUtil::alignedFree ( void *  Ptr)
static

Deallocates the memory referenced by Ptr.

Definition at line 268 of file os_util.cpp.

References cl::sycl::detail::usm::free().

◆ getCurrentDSODir()

static std::string cl::sycl::detail::OSUtil::getCurrentDSODir ( )
static

Returns an absolute path to a directory where the object was found.

◆ getDirName()

static std::string cl::sycl::detail::OSUtil::getDirName ( const char Path)
static

Returns a directory component of a path.

◆ getOSMemSize()

size_t cl::sycl::detail::OSUtil::getOSMemSize ( )
static

Returns the amount of RAM available for the operating system.

Definition at line 238 of file os_util.cpp.

◆ getOSModuleHandle()

static OSModuleHandle cl::sycl::detail::OSUtil::getOSModuleHandle ( const void *  VirtAddr)
static

Returns a module enclosing given address or nullptr.

◆ isPathPresent()

static bool cl::sycl::detail::OSUtil::isPathPresent ( const std::string &  Path)
inlinestatic

Checks if specified path is present.

Definition at line 90 of file os_util.hpp.

Referenced by cl::sycl::detail::PersistentDeviceCodeCache::getItemFromDisc(), and cl::sycl::detail::PersistentDeviceCodeCache::putItemToDisc().

◆ makeDir()

int cl::sycl::detail::OSUtil::makeDir ( const char Dir)
static

Make directory recursively and returns zero code on success.

Definition at line 280 of file os_util.cpp.

Referenced by cl::sycl::detail::PersistentDeviceCodeCache::putItemToDisc().

Member Data Documentation

◆ DirSep

constexpr const char* cl::sycl::detail::OSUtil::DirSep = "/"
staticconstexpr

Definition at line 73 of file os_util.hpp.

◆ DummyModuleHandle

constexpr OSModuleHandle cl::sycl::detail::OSUtil::DummyModuleHandle = -2
staticconstexpr

Dummy module handle to designate non-existing module for a device binary image loaded from file e.g.

via SYCL_USE_KERNEL_SPV env var.

Definition at line 68 of file os_util.hpp.

◆ ExeModuleHandle

constexpr OSModuleHandle cl::sycl::detail::OSUtil::ExeModuleHandle = -1
staticconstexpr

Module handle for the executable module - it is assumed there is always single one at most.

Definition at line 64 of file os_util.hpp.


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