-
Notifications
You must be signed in to change notification settings - Fork 78
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
Construct cds prior to UDF_LoadKernels #337
Comments
Defining kernel properties in UDF_LoadKernels() based on runtime quantities like nrs->cds->fieldOffset[0]) will break the pre-compilation feature. Is there another usecase where this is needed? If not, I will close this issue for now. |
Well technically you can define kernel properties using |
It's not any different. Whenever you define a runtime variable as a kernel parameter it will break the pre-compilation feature. |
This works:
I'm using it in a case right now, and pre-compilation doesn't break. |
Pre-compilation (running nekRS with --build-only) will only work as expected if kernels don’t have to be recompiled at runtime. If a kernel parameter depends on a runtime variable a rebuild (at runtime) is required. |
I see. But in that case, there's nothing enforcing me from not doing Because you can already break pre-compilation, my suggestion only requests we should not limit people who don't use pre-compilation at all by those requirements (and the code design as-is already follows this paradigm). |
Hi April, Breaking pre-compilation is not something that we are really able to support. If anything, we'd want to guard against using, e.g., |
I understand your point of view. Here's what I would suggest then.
The alternative for every Cardinal input is to instead have the user print |
There is a Line 6 in 723cd46
We'll have to give this a little thought whenever we implement I'm going to go ahead and mark this issue as "closed". Please feel free to open it again if you have any additional questions. Thanks! |
That's perfect, thanks for pointing me to it! |
Describe the bug
The
UDF_LoadKernels
allows you to define kernel variables that can be accessed on the device, with syntax likekernelInfo["defines/p_myVar"] = 3.5
. However, becausenrs->cds
is set up after callingUDF_LoadKernels
, you cannot currently define any kernel variables that use member variables ofcds
.To Reproduce
Try to declare a kernel variable like this, in
UDF_LoadKernels
:You will get a seg fault because
nrs->cds->fieldOffset[0]
doesn't exist yet.Expected behavior
If
nrs
exists, it is reasonable to expect thatcds
also exists, since both represent parts of the problem setup and solve. Users may want to declare kernel variables depending oncds
, but the current order of setup prevents that.Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: