File tree Expand file tree Collapse file tree 3 files changed +9
-0
lines changed Expand file tree Collapse file tree 3 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,8 @@ namespace occa {
41
41
const udim_t bytes,
42
42
const occa::properties &props);
43
43
44
+ friend void * getMappedPtr (occa::memory mem);
45
+
44
46
public:
45
47
hipDeviceptr_t hipPtr;
46
48
char *mappedPtr;
Original file line number Diff line number Diff line change @@ -96,6 +96,8 @@ namespace occa {
96
96
97
97
hipCtx_t getContext (occa::device device);
98
98
99
+ void * getMappedPtr (occa::memory mem);
100
+
99
101
occa::device wrapDevice (hipDevice_t device,
100
102
hipCtx_t context,
101
103
const occa::properties &props = occa::properties());
Original file line number Diff line number Diff line change @@ -177,6 +177,11 @@ namespace occa {
177
177
return ((hip::device*) device.getModeDevice ())->hipContext ;
178
178
}
179
179
180
+ void * getMappedPtr (occa::memory mem) {
181
+ hip::memory *handle = (hip::memory*) mem.getMHandle ();
182
+ return handle ? handle->mappedPtr : NULL ;
183
+ }
184
+
180
185
occa::device wrapDevice (hipDevice_t device,
181
186
hipCtx_t context,
182
187
const occa::properties &props) {
You can’t perform that action at this time.
0 commit comments