Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the functinal form of 'assertOnGpu' #25854

Merged
merged 2 commits into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions compiler/codegen/cg-expr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6288,9 +6288,6 @@ DEFINE_BASIC_PRIM(START_RMEM_FENCE)
DEFINE_BASIC_PRIM(FINISH_RMEM_FENCE)

DEFINE_PRIM(ASSERT_ON_GPU) {
// Remove the string argument to the GPU primitive.
call->get(1)->remove();

ret = call->codegenBasicPrimitiveExpr();
}

Expand Down
8 changes: 1 addition & 7 deletions compiler/optimizations/gpuTransforms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion modules/standard/AutoGpu.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
18 changes: 3 additions & 15 deletions modules/standard/GPU.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -227,7 +215,7 @@ module GPU
pragma "codegen for GPU"
extern "chpl_gpu_force_warp_sync" proc chpl_syncWarp(mask);

__primitive("chpl_assert_on_gpu", false);
__primitive("chpl_assert_on_gpu");
chpl_syncWarp(mask);
}

Expand Down Expand Up @@ -377,7 +365,7 @@ module GPU
pragma "codegen for GPU"
extern rtName proc chpl_atomicBinOp(x, val) : T;

__primitive("chpl_assert_on_gpu", false);
__primitive("chpl_assert_on_gpu");
return chpl_atomicBinOp(c_ptrTo(x), val);
}

Expand All @@ -388,7 +376,7 @@ module GPU
pragma "codegen for GPU"
extern rtName proc chpl_atomicTernOp(x, cmp, val) : T;

__primitive("chpl_assert_on_gpu", false);
__primitive("chpl_assert_on_gpu");
return chpl_atomicTernOp(c_ptrTo(x), cmp, val);
}

Expand Down
15 changes: 0 additions & 15 deletions test/gpu/native/assertOnFailToGpuize.1.good

This file was deleted.

14 changes: 0 additions & 14 deletions test/gpu/native/assertOnFailToGpuize.2.good

This file was deleted.

14 changes: 0 additions & 14 deletions test/gpu/native/assertOnFailToGpuize.3.good

This file was deleted.

10 changes: 0 additions & 10 deletions test/gpu/native/assertOnFailToGpuize.4.good

This file was deleted.

82 changes: 0 additions & 82 deletions test/gpu/native/assertOnFailToGpuize.chpl

This file was deleted.

11 changes: 0 additions & 11 deletions test/gpu/native/assertOnFailToGpuize.compopts

This file was deleted.

2 changes: 1 addition & 1 deletion test/users/engin/context/gpuSharedMem.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ config const n = 20;
on here.gpus[0] {
var A : [0..<N] uint;

@assertOnGpu
foreach i in simpleOneDim(N) { // context should be coming from a new syntax
assertOnGpu();
const context = new Context();
const vectorContext = __primitive("outer context", context);

Expand Down