You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, to outline a GPU kernel, we pass variables by pointer regardless and then dereference them. Therefore, symbol renaming is always required. However, this is only sometimes necessary. If we pass a private variable that won't be shared between threads, we can pass them by value. Then the outlined kernel doesn't have to rename them.
For shared variables and arrays, we still pass them by the pointer.
To sum up:
private: No need to pass anything to the kernel. Declare a local variable using the original name without initialization.
fistprivate: Pass the original value to the kernel using a different name. Declare a local variable using the original name, which is initialized with passed value.
shared: Pass the original variable by pointer. It needs renaming.
lastprivate: The same as shared. We need to store the final value back to the original variable.
map: We can use the original name for arrays. But for scalars, it may need to be shared between different kernels. In that case, they need renaming like shared clause.
The text was updated successfully, but these errors were encountered:
Currently, to outline a GPU kernel, we pass variables by pointer regardless and then dereference them. Therefore, symbol renaming is always required. However, this is only sometimes necessary. If we pass a private variable that won't be shared between threads, we can pass them by value. Then the outlined kernel doesn't have to rename them.
For shared variables and arrays, we still pass them by the pointer.
To sum up:
private
: No need to pass anything to the kernel. Declare a local variable using the original name without initialization.fistprivate
: Pass the original value to the kernel using a different name. Declare a local variable using the original name, which is initialized with passed value.shared
: Pass the original variable by pointer. It needs renaming.lastprivate
: The same asshared
. We need to store the final value back to the original variable.map
: We can use the original name for arrays. But for scalars, it may need to be shared between different kernels. In that case, they need renaming likeshared
clause.The text was updated successfully, but these errors were encountered: