Verify global_barrier, indexing, private array inside device_func #1391
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The existing
func
decorator has several design limitation that does not allow usage of features such asbarrier
,dpex.local.array
anddpex.private.array
inside afunc
decorated function. These limitations reduced the utility of the feature. See: https://github.com/soda-inria/sklearn-numba-dpex/blob/747914481371ee7fe6527240a7bb57104d207115/sklearn_numba_dpex/kmeans/kernels/lloyd_single_step.py#L142All these limitations are addressed by the new
experimental.device_func
decorator. The PR adds unit tests to verify thatkernel_api.global_barrier
andkernel_api.PrivateArray
can be used in adevice_func
decorated function.