Tinker9
70bd052 (Thu Nov 9 12:11:35 2023 -0800)
Loading...
Searching...
No Matches
include
tool
thrustcache.h
1
#pragma once
2
#include <cstddef>
3
4
namespace
tinker
{
12
class
ThrustCache
13
{
14
public
:
15
using
value_type
= char;
16
ThrustCache
();
17
value_type
*
allocate
(ptrdiff_t);
18
void
deallocate
(
value_type
*,
size_t
);
19
void
clear
();
20
21
static
ThrustCache
&
instance
();
22
static
void
allocate
();
23
static
void
deallocate
();
24
25
private
:
26
value_type
* ptr;
27
size_t
nbytes;
28
};
29
}
tinker::ThrustCache::deallocate
void deallocate(value_type *, size_t)
Does not do anything.
tinker::ThrustCache::ThrustCache
ThrustCache()
tinker::ThrustCache::instance
static ThrustCache & instance()
Returns the reference to the singleton object.
tinker::ThrustCache::clear
void clear()
Deallocates the memory.
tinker::ThrustCache::value_type
char value_type
Definition:
thrustcache.h:15
tinker::ThrustCache::allocate
value_type * allocate(ptrdiff_t)
Expands and returns the allocated memory upon request.
tinker::ThrustCache::allocate
static void allocate()
Allocates the memory managed by the singleton object.
tinker::ThrustCache::deallocate
static void deallocate()
Deallocates the memory managed by the singleton object.
tinker::ThrustCache
Device memory cache (allocator) for the Thrust Library.
Definition:
thrustcache.h:13
tinker
Definition:
testrt.h:9
Generated by
1.9.5