We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4de9fbb commit 9018626Copy full SHA for 9018626
src/host/indexing.jl
@@ -51,7 +51,13 @@ Assert that a certain operation `op` performs scalar indexing. If this is not al
51
error will be thrown ([`allowscalar`](@ref)).
52
"""
53
function assertscalar(op = "operation")
54
- val = get(task_local_storage(), :ScalarIndexing, ScalarWarn)
+ val = get!(task_local_storage(), :ScalarIndexing) do
55
+ if haskey(ENV, "JULIA_GPU_ALLOWSCALAR")
56
+ parse(Bool, ENV["JULIA_GPU_ALLOWSCALAR"]) ? ScalarAllowed : ScalarDisallowed
57
+ else
58
+ ScalarWarn
59
+ end
60
61
if val == ScalarDisallowed
62
error("$op is disallowed")
63
elseif val == ScalarWarn
0 commit comments