Skip to content

SYCL device property init writes maxGridSize[0] three times #4994

@WeiqunZhang

Description

@WeiqunZhang
  • Type: Correctness / Copy-paste index bug
  • Severity: Medium
  • Component: GPU device capability initialization (SYCL)
  • Location: Src/Base/AMReX_GpuDevice.cpp:568

Problem

In the SYCL initialization path, maxGridSize is assigned three times to index 0:

device_prop.maxGridSize[0] = -1;
device_prop.maxGridSize[0] = -1;
device_prop.maxGridSize[0] = -1;

Indices 1 and 2 are never explicitly assigned here.

Impact

  • Directional limits become inconsistent (dir=1/dir=2 may keep default values).
  • If maxBlocksPerGrid(1|2) is used, behavior can diverge from intended “unknown = -1” sentinel.

Suggested patch

--- a/Src/Base/AMReX_GpuDevice.cpp
+++ b/Src/Base/AMReX_GpuDevice.cpp
@@
-        device_prop.maxGridSize[0] = -1; // xxxxx SYCL todo: unknown
-        device_prop.maxGridSize[0] = -1; // unknown
-        device_prop.maxGridSize[0] = -1; // unknown
+        device_prop.maxGridSize[0] = -1; // xxxxx SYCL todo: unknown
+        device_prop.maxGridSize[1] = -1; // unknown
+        device_prop.maxGridSize[2] = -1; // unknown

Prepared by Codex

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions