Skip to content
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

Allow to construct array in device functions #115

Open
JValGLZ opened this issue Sep 20, 2024 · 0 comments
Open

Allow to construct array in device functions #115

JValGLZ opened this issue Sep 20, 2024 · 0 comments

Comments

@JValGLZ
Copy link

JValGLZ commented Sep 20, 2024

Part of my code uses a function to populate an array that holds 5 floats. The array is loaded with information that changes per iteration. The max value in that array is found then stored in another array. Initially, I wanted to create the array within the device meaning a new array would hold the calculated values. When I tried to do this, I got the following two errors:

Reason: unsupported call through a literal pointer (call to ijl_alloc_array_1d)
Reason: unsupported dynamic function invocation

Instead I preallocated a JACC array that would be holding the five values and placed it as an argument in my parallel_for function. I set up a for loop to set all values to zero before any calculation was performed so that it may be cleared. The issue was that once I checked the data in that array, it was always from the first iteration. The array had kept the data from the previous calculation even though it was being cleared before the calculation was performed.

I believe by using the same preallocated array, there is some issue with clearing the data and updating.

Perhaps allowing the construction of an array within the device function would clear this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant