DPC++ Runtime
Runtime libraries for oneAPI Data Parallel C++
usm_allocator.cpp File Reference
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cctype>
#include <iomanip>
#include <iostream>
#include <list>
#include <memory>
#include <mutex>
#include <shared_mutex>
#include <string>
#include <unordered_map>
#include <utility>
#include <vector>
#include "usm_allocator.hpp"
#include <CL/sycl/detail/spinlock.hpp>
Include dependency graph for usm_allocator.cpp:

Go to the source code of this file.

Classes

class  settings::SetLimits
 
class  Slab
 
class  Bucket
 
class  USMAllocContext::USMAllocImpl
 

Namespaces

 settings
 

Macros

#define P(n)   (1ULL << n)
 

Typedefs

using settings::BucketsArrayType = std::array< size_t, 53 >
 

Functions

static constexpr BucketsArrayType settings::generateBucketSizes ()
 
static void * AlignPtrDown (void *Ptr, const size_t Alignment)
 
static void * AlignPtrUp (void *Ptr, const size_t Alignment)
 
static size_t AlignUp (size_t Val, size_t Alignment)
 
bool operator== (const Slab &Lhs, const Slab &Rhs)
 
std::ostream & operator<< (std::ostream &Os, const Slab &Slab)
 
bool enableBufferPooling ()
 

Variables

static constexpr size_t settings::CutOff = (size_t)1 << 31
 
static constexpr BucketsArrayType settings::BucketSizes = generateBucketSizes()
 
static sycl::detail::SpinLock settings::PoolLock
 
static class settings::SetLimits settings::USMSettings
 
static const charMemTypeNames [3] = {"Host", "Device", "Shared"}
 

Macro Definition Documentation

◆ P

#define P (   n)    (1ULL << n)

Function Documentation

◆ AlignPtrDown()

static void* AlignPtrDown ( void *  Ptr,
const size_t  Alignment 
)
static

Definition at line 317 of file usm_allocator.cpp.

Referenced by AlignPtrUp(), and USMAllocContext::USMAllocImpl::deallocate().

◆ AlignPtrUp()

static void* AlignPtrUp ( void *  Ptr,
const size_t  Alignment 
)
static

Definition at line 324 of file usm_allocator.cpp.

References AlignPtrDown().

Referenced by USMAllocContext::USMAllocImpl::allocate().

◆ AlignUp()

static size_t AlignUp ( size_t  Val,
size_t  Alignment 
)
static

Definition at line 335 of file usm_allocator.cpp.

Referenced by USMAllocContext::USMAllocImpl::allocate().

◆ enableBufferPooling()

bool enableBufferPooling ( )

◆ operator<<()

std::ostream& operator<< ( std::ostream &  Os,
const Slab Slab 
)

◆ operator==()

bool operator== ( const Slab Lhs,
const Slab Rhs 
)

Definition at line 546 of file usm_allocator.cpp.

References Slab::getPtr().

Referenced by cl::sycl::kernel::operator!=().

Variable Documentation

◆ MemTypeNames

const char* MemTypeNames[3] = {"Host", "Device", "Shared"}
static

Definition at line 313 of file usm_allocator.cpp.

Referenced by USMAllocContext::allocate(), and USMAllocContext::deallocate().