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

argon2-opencl fix for macOS #5420

Merged
merged 1 commit into from
Apr 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions run/opencl/argon2_kernel.cl
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ ulong u64_shuffle_warp(ulong v, uint thread_src)
ulong u64_shuffle(ulong v, uint thread_src, uint thread, __local ulong *buf)
#endif
{
#if USE_WARP_SHUFFLE && gpu_nvidia(DEVICE_INFO) && SM_MAJOR >= 3
#if USE_WARP_SHUFFLE && !__OS_X__ && gpu_nvidia(DEVICE_INFO) && SM_MAJOR >= 3
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we can't use inline asm even on NVIDIA, then the equivalent of this change should be on host, because the #else path this triggers here requires local memory and we conditionally provide its allocation size from host (on NVIDIA, we currently don't).

ulong result;

asm("{\n\t"
Expand Down Expand Up @@ -97,7 +97,7 @@ ulong u64_shuffle(ulong v, uint thread_src, uint thread, __local ulong *buf)
// TODO: Test on other device types to add support
#if !gpu_nvidia(DEVICE_INFO) && !gpu_amd(DEVICE_INFO)
barrier(CLK_LOCAL_MEM_FENCE);
#elif gpu_amd(DEVICE_INFO) && DEV_VER_MAJOR < 2500
#elif !__OS_X__ && gpu_amd(DEVICE_INFO) && DEV_VER_MAJOR < 2500
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am surprised the asm here was reached for you - we only reach it on ancient AMD driver. Maybe the real issue is we somehow fail to set DEV_VER_MAJOR on macOS? Anyway, I don't mind this change.

asm("" ::: "memory");
#endif
return buf[thread_src];
Expand Down