[Chapel Merge] Add a warning when `gpuClock` is called from the host

Branch: refs/heads/main
Revision: c8769c143f04a93d45476989d5646d2eefe13e9b
Author: e-kayrakli
Link: Add a warning when `gpuClock` is called from the host by e-kayrakli · Pull Request #27022 · chapel-lang/chapel · GitHub
Log Message:
Add a warning when gpuClock is called from the host (#27022)

Inspired by this discourse
topic
.

This PR adds a warning when gpuClock is called from the host. When
that happens we always return 0 silently. Understandably, that can be
confusing.

There's a question of whether that warning should be suppressable when
the same loop is executed both on the CPU and the GPU, for example.
However, I see gpuClock as an advanced feature that should not be
widely used. So, this PR doesn't go that far.

[Reviewed by @jabraham17]

Test:

  • amd

Compare: Comparing 167d50b152f5b9c9833be428ce00e6ad231e41dd...f1c6731a01eea5711866482ec096931d5b24c45e · chapel-lang/chapel · GitHub

Diff:
M modules/standard/GPU.chpl
M runtime/include/gpu/chpl-gpu-gen-common.h
A test/gpu/native/basics/gpuClockOnHost.chpl
A test/gpu/native/basics/gpuClockOnHost.good
https://github.com/chapel-lang/chapel/pull/27022.diff