Skip to content

Commit

Permalink
[GC] OpenMP GC error fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dmed256 committed Aug 26, 2018
1 parent 95f53f3 commit 1024a62
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/mode/openmp/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ namespace occa {
allKernelProps);

if (k && usingOpenMP) {
k->modeDevice->removeRef();
k->modeDevice->removeKernelRef(k);
k->modeDevice = this;
addRef();
addKernelRef(k);
}

return k;
Expand Down
13 changes: 12 additions & 1 deletion tests/src/c/memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,19 @@ void testInteropMethods() {
ptr[i] = i;
}

mem2 = occaWrapCpuMemory(ptr, bytes);
mem2 = occaWrapCpuMemory(occaHost(),
ptr,
bytes,
occaDefault);

occaProperties props = (
occaCreatePropertiesFromString("foo: 'bar'")
);
mem2 = occaWrapCpuMemory(occaHost(),
ptr,
bytes,
props);
occaFree(mem1);
occaFree(mem2);
occaFree(props);
}
6 changes: 3 additions & 3 deletions tests/src/tools/gc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ void testWithRefs() {
}

void testRingEntry() {
occa::gc::ringEntry a, b;
occa::gc::ringEntry_t a, b;

ASSERT_EQ(a.leftRingEntry,
&a);
Expand All @@ -96,8 +96,8 @@ void testRingEntry() {
}

void testRing() {
occa::gc::ringEntry a, b, c;
occa::gc::ring<occa::gc::ringEntry> values;
occa::gc::ringEntry_t a, b, c;
occa::gc::ring_t<occa::gc::ringEntry_t> values;

ASSERT_EQ((void*) values.head,
(void*) NULL);
Expand Down

0 comments on commit 1024a62

Please sign in to comment.