diff --git a/compiler/optimizations/gpuTransforms.cpp b/compiler/optimizations/gpuTransforms.cpp index 0ab1bc4ab981..7072581731ff 100644 --- a/compiler/optimizations/gpuTransforms.cpp +++ b/compiler/optimizations/gpuTransforms.cpp @@ -414,13 +414,7 @@ class GpuAssertionReporter { if (assertion->isPrimitive(PRIM_ASSERT_GPU_ELIGIBLE)) { reason = "is marked with @gpu.assertEligible"; } else { - INT_ASSERT(assertion->isPrimitive(PRIM_ASSERT_ON_GPU)); - reason = "contains assertOnGpu()"; - auto isAttributeSym = toSymExpr(assertion->get(1)); - INT_ASSERT(isAttributeSym); - if (isAttributeSym->symbol() == gTrue) { - reason = "is marked with @assertOnGpu"; - } + reason = "is marked with @assertOnGpu"; } USR_FATAL_CONT(loc, "Loop %s but is not eligible for execution on a GPU", reason); } diff --git a/modules/standard/AutoGpu.chpl b/modules/standard/AutoGpu.chpl index 0649ad47b149..14b1913053b3 100644 --- a/modules/standard/AutoGpu.chpl +++ b/modules/standard/AutoGpu.chpl @@ -44,7 +44,7 @@ module AutoGpu { "that the code can be executed on the GPU without ", "runtime checks."); } - __primitive("chpl_assert_on_gpu", true); + __primitive("chpl_assert_on_gpu"); } inline proc chpl__gpuBlockSizeAttr(param counter: int, arg: integral) { diff --git a/modules/standard/GPU.chpl b/modules/standard/GPU.chpl index 8b3844f27219..6bea713aa74d 100644 --- a/modules/standard/GPU.chpl +++ b/modules/standard/GPU.chpl @@ -133,18 +133,6 @@ module GPU gpuWrite((...args), "\n":c_ptrConst(c_char)); } - /* - Will halt execution at runtime if called from outside a GPU. If used on - first line in ``foreach`` or ``forall`` loop will also do a compile time - check that the loop is eligible for execution on a GPU. - */ - pragma "insert line file info" - pragma "always propagate line file info" - @deprecated(notes="the functional form of assertOnGpu() is deprecated. Please use the @assertOnGpu loop attribute instead.") - inline proc assertOnGpu() { - __primitive("chpl_assert_on_gpu", false); - } - /* Returns value of a per-multiprocessor counter that increments every clock cycle. This function is meant to be called to time sections of code within a GPU diff --git a/test/gpu/native/assertOnFailToGpuize.1.good b/test/gpu/native/assertOnFailToGpuize.1.good deleted file mode 100644 index d60220a8d202..000000000000 --- a/test/gpu/native/assertOnFailToGpuize.1.good +++ /dev/null @@ -1,15 +0,0 @@ -assertOnFailToGpuize.chpl:16: In function 'funcMarkedNotGpuizableThatTriesToGpuize': -assertOnFailToGpuize.chpl:18: warning: the functional form of assertOnGpu() is deprecated. Please use the @assertOnGpu loop attribute instead. -assertOnFailToGpuize.chpl:50: warning: the functional form of assertOnGpu() is deprecated. Please use the @assertOnGpu loop attribute instead. -assertOnFailToGpuize.chpl:55: warning: the functional form of assertOnGpu() is deprecated. Please use the @assertOnGpu loop attribute instead. -assertOnFailToGpuize.chpl:62: warning: the functional form of assertOnGpu() is deprecated. Please use the @assertOnGpu loop attribute instead. -assertOnFailToGpuize.chpl:70: warning: the functional form of assertOnGpu() is deprecated. Please use the @assertOnGpu loop attribute instead. -assertOnFailToGpuize.chpl:75: warning: the functional form of assertOnGpu() is deprecated. Please use the @assertOnGpu loop attribute instead. -assertOnFailToGpuize.chpl:76: warning: the functional form of assertOnGpu() is deprecated. Please use the @assertOnGpu loop attribute instead. -assertOnFailToGpuize.chpl:78: warning: the functional form of assertOnGpu() is deprecated. Please use the @assertOnGpu loop attribute instead. -assertOnFailToGpuize.chpl:79: warning: the functional form of assertOnGpu() is deprecated. Please use the @assertOnGpu loop attribute instead. -assertOnFailToGpuize.chpl:80: warning: the functional form of assertOnGpu() is deprecated. Please use the @assertOnGpu loop attribute instead. -assertOnFailToGpuize.chpl:81: warning: the functional form of assertOnGpu() is deprecated. Please use the @assertOnGpu loop attribute instead. -assertOnFailToGpuize.chpl:16: In function 'funcMarkedNotGpuizableThatTriesToGpuize': -assertOnFailToGpuize.chpl:17: error: Loop contains assertOnGpu() but is not eligible for execution on a GPU -assertOnFailToGpuize.chpl:16: note: parent function disallows execution on a GPU diff --git a/test/gpu/native/assertOnFailToGpuize.2.good b/test/gpu/native/assertOnFailToGpuize.2.good deleted file mode 100644 index 989d492c2b04..000000000000 --- a/test/gpu/native/assertOnFailToGpuize.2.good +++ /dev/null @@ -1,14 +0,0 @@ -assertOnFailToGpuize.chpl:32: warning: the functional form of assertOnGpu() is deprecated. Please use the @assertOnGpu loop attribute instead. -assertOnFailToGpuize.chpl:50: warning: the functional form of assertOnGpu() is deprecated. Please use the @assertOnGpu loop attribute instead. -assertOnFailToGpuize.chpl:55: warning: the functional form of assertOnGpu() is deprecated. Please use the @assertOnGpu loop attribute instead. -assertOnFailToGpuize.chpl:62: warning: the functional form of assertOnGpu() is deprecated. Please use the @assertOnGpu loop attribute instead. -assertOnFailToGpuize.chpl:70: warning: the functional form of assertOnGpu() is deprecated. Please use the @assertOnGpu loop attribute instead. -assertOnFailToGpuize.chpl:75: warning: the functional form of assertOnGpu() is deprecated. Please use the @assertOnGpu loop attribute instead. -assertOnFailToGpuize.chpl:76: warning: the functional form of assertOnGpu() is deprecated. Please use the @assertOnGpu loop attribute instead. -assertOnFailToGpuize.chpl:78: warning: the functional form of assertOnGpu() is deprecated. Please use the @assertOnGpu loop attribute instead. -assertOnFailToGpuize.chpl:79: warning: the functional form of assertOnGpu() is deprecated. Please use the @assertOnGpu loop attribute instead. -assertOnFailToGpuize.chpl:80: warning: the functional form of assertOnGpu() is deprecated. Please use the @assertOnGpu loop attribute instead. -assertOnFailToGpuize.chpl:81: warning: the functional form of assertOnGpu() is deprecated. Please use the @assertOnGpu loop attribute instead. -assertOnFailToGpuize.chpl:31: error: Loop contains assertOnGpu() but is not eligible for execution on a GPU -assertOnFailToGpuize.chpl:23: note: function is marked as not eligible for GPU execution -assertOnFailToGpuize.chpl:33: note: reached via call to 'funcMarkedNotGpuizable' in loop body here diff --git a/test/gpu/native/assertOnFailToGpuize.3.good b/test/gpu/native/assertOnFailToGpuize.3.good deleted file mode 100644 index edc1ca4ff925..000000000000 --- a/test/gpu/native/assertOnFailToGpuize.3.good +++ /dev/null @@ -1,14 +0,0 @@ -assertOnFailToGpuize.chpl:39: warning: the functional form of assertOnGpu() is deprecated. Please use the @assertOnGpu loop attribute instead. -assertOnFailToGpuize.chpl:50: warning: the functional form of assertOnGpu() is deprecated. Please use the @assertOnGpu loop attribute instead. -assertOnFailToGpuize.chpl:55: warning: the functional form of assertOnGpu() is deprecated. Please use the @assertOnGpu loop attribute instead. -assertOnFailToGpuize.chpl:62: warning: the functional form of assertOnGpu() is deprecated. Please use the @assertOnGpu loop attribute instead. -assertOnFailToGpuize.chpl:70: warning: the functional form of assertOnGpu() is deprecated. Please use the @assertOnGpu loop attribute instead. -assertOnFailToGpuize.chpl:75: warning: the functional form of assertOnGpu() is deprecated. Please use the @assertOnGpu loop attribute instead. -assertOnFailToGpuize.chpl:76: warning: the functional form of assertOnGpu() is deprecated. Please use the @assertOnGpu loop attribute instead. -assertOnFailToGpuize.chpl:78: warning: the functional form of assertOnGpu() is deprecated. Please use the @assertOnGpu loop attribute instead. -assertOnFailToGpuize.chpl:79: warning: the functional form of assertOnGpu() is deprecated. Please use the @assertOnGpu loop attribute instead. -assertOnFailToGpuize.chpl:80: warning: the functional form of assertOnGpu() is deprecated. Please use the @assertOnGpu loop attribute instead. -assertOnFailToGpuize.chpl:81: warning: the functional form of assertOnGpu() is deprecated. Please use the @assertOnGpu loop attribute instead. -assertOnFailToGpuize.chpl:38: error: Loop contains assertOnGpu() but is not eligible for execution on a GPU -assertOnFailToGpuize.chpl:13: note: called function has outer var access -assertOnFailToGpuize.chpl:40: note: reached via call to 'usesOutsideVar' in loop body here diff --git a/test/gpu/native/assertOnFailToGpuize.4.good b/test/gpu/native/assertOnFailToGpuize.4.good deleted file mode 100644 index 65050fd7f469..000000000000 --- a/test/gpu/native/assertOnFailToGpuize.4.good +++ /dev/null @@ -1,10 +0,0 @@ -assertOnFailToGpuize.chpl:50: warning: the functional form of assertOnGpu() is deprecated. Please use the @assertOnGpu loop attribute instead. -assertOnFailToGpuize.chpl:55: warning: the functional form of assertOnGpu() is deprecated. Please use the @assertOnGpu loop attribute instead. -assertOnFailToGpuize.chpl:62: warning: the functional form of assertOnGpu() is deprecated. Please use the @assertOnGpu loop attribute instead. -assertOnFailToGpuize.chpl:70: warning: the functional form of assertOnGpu() is deprecated. Please use the @assertOnGpu loop attribute instead. -assertOnFailToGpuize.chpl:75: warning: the functional form of assertOnGpu() is deprecated. Please use the @assertOnGpu loop attribute instead. -assertOnFailToGpuize.chpl:76: warning: the functional form of assertOnGpu() is deprecated. Please use the @assertOnGpu loop attribute instead. -assertOnFailToGpuize.chpl:78: warning: the functional form of assertOnGpu() is deprecated. Please use the @assertOnGpu loop attribute instead. -assertOnFailToGpuize.chpl:79: warning: the functional form of assertOnGpu() is deprecated. Please use the @assertOnGpu loop attribute instead. -assertOnFailToGpuize.chpl:80: warning: the functional form of assertOnGpu() is deprecated. Please use the @assertOnGpu loop attribute instead. -assertOnFailToGpuize.chpl:81: warning: the functional form of assertOnGpu() is deprecated. Please use the @assertOnGpu loop attribute instead. diff --git a/test/gpu/native/assertOnFailToGpuize.chpl b/test/gpu/native/assertOnFailToGpuize.chpl deleted file mode 100644 index b4c7b15a3542..000000000000 --- a/test/gpu/native/assertOnFailToGpuize.chpl +++ /dev/null @@ -1,82 +0,0 @@ -// This test and assertOnFailToGpuizeAttr are siblings; they both test the -// same functionality, one as a "magic function call" (this one) and one as -// an attribute (the other one). - -use GPU; - -config param failureMode = 8; -var globalVar = 0; - -proc directlyRecursiveFunc(i:int) { if i > 0 then directlyRecursiveFunc(i-1); } -proc indirectlyRecursiveFunc(i:int) { if i > 0 then indirectlyRecursiveFunc2(i-1); } -proc indirectlyRecursiveFunc2(i:int) { if i > 0 then indirectlyRecursiveFunc(i-1); } -proc usesOutsideVar() { return globalVar; } - -pragma "no gpu codegen" -proc funcMarkedNotGpuizableThatTriesToGpuize() { - foreach i in 0..10 { - assertOnGpu(); - } -} - -pragma "no gpu codegen" -proc funcMarkedNotGpuizable() { } - -on here.gpus[0] { - if failureMode == 1 { - funcMarkedNotGpuizableThatTriesToGpuize(); - } - - if failureMode == 2 { - foreach i in 0..10 { - assertOnGpu(); - funcMarkedNotGpuizable(); - } - } - - if failureMode == 3 { - foreach i in 0..10 { - assertOnGpu(); - usesOutsideVar(); - } - } - - // Also ensure that assertOnGpu does not fail - // for the following (use failureMode >= 4 - // to run these tests): - - // calling a recursive function is allowed now - foreach i in 0..10 { - assertOnGpu(); - directlyRecursiveFunc(i); - } - - foreach i in 0..10 { - assertOnGpu(); - indirectlyRecursiveFunc(i); - } - - // I want to ensure this works - // with forall loops as well: - forall i in 0..10 { - assertOnGpu(); - directlyRecursiveFunc(i); - } - - // And loops of a multidimensional array: - { - var A: [1..10, 1..10] int; - foreach a in A { - assertOnGpu(); - directlyRecursiveFunc(5); - } - } - - foreach i in 0..10 { assertOnGpu(); } - forall i in 0..10 { assertOnGpu(); } - var A: [1..10, 1..10] int; - foreach a in A { assertOnGpu(); } - foreach idx in {0..10, 0..10} { assertOnGpu(); } - forall a in A { assertOnGpu(); } - forall idx in {0..10, 0..10} { assertOnGpu(); } -} diff --git a/test/gpu/native/assertOnFailToGpuize.compopts b/test/gpu/native/assertOnFailToGpuize.compopts deleted file mode 100755 index ceb0c17df324..000000000000 --- a/test/gpu/native/assertOnFailToGpuize.compopts +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env python3 - -import os - -for i in range(1, 5): - # We currently skip configuration 3 when CHPL_COMM is not none see - # https://github.com/chapel-lang/chapel/issues/20641. TODO: re-enable this - # once this works in our gasnet configuration. - if i == 3 and os.getenv('CHPL_COMM') != 'none': - continue - print('-sfailureMode={} # assertOnFailToGpuize.{}.good'.format(i, i)) diff --git a/test/users/engin/context/gpuSharedMem.chpl b/test/users/engin/context/gpuSharedMem.chpl index cd0e9435d719..dfc6ac2c7ac3 100644 --- a/test/users/engin/context/gpuSharedMem.chpl +++ b/test/users/engin/context/gpuSharedMem.chpl @@ -12,8 +12,8 @@ config const n = 20; on here.gpus[0] { var A : [0..