OmniSciDB  72c90bc290
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
l0 Namespace Reference

Classes

class  L0Exception
 
class  L0Driver
 
class  L0Device
 
class  L0Module
 
class  L0Kernel
 
class  L0CommandQueue
 
class  L0CommandList
 
class  L0Manager
 

Typedefs

using L0result = int
 

Functions

std::vector< std::shared_ptr
< L0Driver > > 
get_drivers ()
 
void * allocate_device_mem (const size_t num_bytes, L0Device &device)
 

Typedef Documentation

using l0::L0result = typedef int

Definition at line 21 of file L0Exception.h.

Function Documentation

void * l0::allocate_device_mem ( const size_t  num_bytes,
L0Device &  device 
)

Definition at line 105 of file L0Mgr.cpp.

References L0_SAFE_CALL.

Referenced by l0::L0Manager::allocateDeviceMem().

105  {
106  ze_device_mem_alloc_desc_t alloc_desc;
107  alloc_desc.stype = ZE_STRUCTURE_TYPE_DEVICE_MEM_ALLOC_DESC;
108  alloc_desc.pNext = nullptr;
109  alloc_desc.flags = 0;
110  alloc_desc.ordinal = 0;
111 
112  void* mem;
113  L0_SAFE_CALL(zeMemAllocDevice(
114  device.ctx(), &alloc_desc, num_bytes, 0 /*align*/, device.device(), &mem));
115  return mem;
116 }
#define L0_SAFE_CALL(call)
Definition: Utils.h:20

+ Here is the caller graph for this function:

std::vector<std::shared_ptr<L0Driver> > l0::get_drivers ( )

Definition at line 67 of file L0Mgr.cpp.

References run_benchmark_import::result.

67  {
68  zeInit(0);
69  uint32_t driver_count = 0;
70  zeDriverGet(&driver_count, nullptr);
71 
72  std::vector<ze_driver_handle_t> handles(driver_count);
73  zeDriverGet(&driver_count, handles.data());
74 
75  std::vector<std::shared_ptr<L0Driver>> result(driver_count);
76  for (int i = 0; i < driver_count; i++) {
77  result[i] = std::make_shared<L0Driver>(handles[i]);
78  }
79  return result;
80 }