Skip to content

Commit

Permalink
#2845 update GOOpenCLTrans to ignore kernel imports of compile-time c…
Browse files Browse the repository at this point in the history
…onstants
  • Loading branch information
arporter committed Jan 30, 2025
1 parent fe8dbbb commit 36d2dfa
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,16 @@ def validate(self, node, options=None):

# Check that we can construct the PSyIR and SymbolTable of each of
# the kernels in this Schedule. Also check that none of them access
# any form of global data (that is not a routine argument).
# any form of global data (that is not a routine argument or a compile-
# time constant).
for kern in node.kernels():
KernelModuleInlineTrans().validate(kern)
ksched = kern.get_kernel_schedule()
global_variables = ksched.symbol_table.imported_symbols
for sym in global_variables[:]:
# Compile-time constants are fine.
if isinstance(sym, DataSymbol) and sym.is_constant:
global_variables.remove(sym)
if global_variables:
raise TransformationError(
f"The Symbol Table for kernel '{kern.name}' contains the "
Expand Down

0 comments on commit 36d2dfa

Please sign in to comment.