Skip to content

cl.LocalMemory -> CLPtr#293

Merged
maleadt merged 2 commits intoJuliaGPU:masterfrom
blegat:clptr
Mar 24, 2025
Merged

cl.LocalMemory -> CLPtr#293
maleadt merged 2 commits intoJuliaGPU:masterfrom
blegat:clptr

Conversation

@blegat
Copy link
Contributor

@blegat blegat commented Mar 21, 2025

I used cl.LocalMem in #291 because I followed what was done in this example
If we follow your suggestion for the jupyter notebook then I guess we could also update it in the example to be consistent.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 21, 2025

Your PR requires formatting changes to meet the project's style guidelines.
Please consider running Runic (git runic master) to apply these changes.

Click here to view the suggested changes.
diff --git a/examples/hands_on_opencl/ex08/matmul.jl b/examples/hands_on_opencl/ex08/matmul.jl
index 6e7513e..80d31c0 100644
--- a/examples/hands_on_opencl/ex08/matmul.jl
+++ b/examples/hands_on_opencl/ex08/matmul.jl
@@ -103,7 +103,8 @@ mmul = cl.Kernel(prg, "mmul")
 for i in 1:COUNT
     fill!(h_C, 0.0)
     cl.queue!(:profile) do
-        evt = clcall(mmul, Tuple{Int32, Int32, Int32, CLPtr{Float32}, CLPtr{Float32}, CLPtr{Float32}},
+        evt = clcall(
+            mmul, Tuple{Int32, Int32, Int32, CLPtr{Float32}, CLPtr{Float32}, CLPtr{Float32}},
                      Mdim, Ndim, Pdim, d_a, d_b, d_c; global_size=(Ndim, Mdim))
         wait(evt)
 
@@ -127,7 +128,8 @@ mmul = cl.Kernel(prg, "mmul")
 for i in 1:COUNT
     fill!(h_C, 0.0)
     cl.queue!(:profile) do
-        evt = clcall(mmul, Tuple{Int32, Int32, Int32, CLPtr{Float32}, CLPtr{Float32}, CLPtr{Float32}},
+        evt = clcall(
+            mmul, Tuple{Int32, Int32, Int32, CLPtr{Float32}, CLPtr{Float32}, CLPtr{Float32}},
                      Mdim, Ndim, Pdim, d_a, d_b, d_c; global_size=Ndim, local_size=(ORDER ÷ 16))
         wait(evt)
 
@@ -159,7 +161,8 @@ for i in 1:COUNT
         global_size = (Ndim,)
         local_size = (div(ORDER, 16),)
 
-        evt = clcall(mmul, Tuple{Int32, Int32, Int32, CLPtr{Float32}, CLPtr{Float32}, CLPtr{Float32}, CLPtr{Float32}},
+            evt = clcall(
+                mmul, Tuple{Int32, Int32, Int32, CLPtr{Float32}, CLPtr{Float32}, CLPtr{Float32}, CLPtr{Float32}},
                      Mdim, Ndim, Pdim, d_a, d_b, d_c, localmem; global_size, local_size)
         wait(evt)
 
@@ -190,7 +193,8 @@ for i in 1:COUNT
     localmem1 = cl.LocalMem(Float32, blocksize^2)
     localmem2 = cl.LocalMem(Float32, blocksize^2)
     cl.queue!(:profile) do
-        evt = clcall(mmul, Tuple{Int32, Int32, Int32, CLPtr{Float32}, CLPtr{Float32}, CLPtr{Float32}, CLPtr{Float32}, CLPtr{Float32}},
+            evt = clcall(
+                mmul, Tuple{Int32, Int32, Int32, CLPtr{Float32}, CLPtr{Float32}, CLPtr{Float32}, CLPtr{Float32}, CLPtr{Float32}},
                      Mdim, Ndim, Pdim, d_a, d_b, d_c, localmem1, localmem2; global_size=Ndim, local_size=(ORDER ÷ 16))
         wait(evt)
 
diff --git a/examples/hands_on_opencl/ex09/pi_ocl.jl b/examples/hands_on_opencl/ex09/pi_ocl.jl
index 86ab9c6..c36da29 100644
--- a/examples/hands_on_opencl/ex09/pi_ocl.jl
+++ b/examples/hands_on_opencl/ex09/pi_ocl.jl
@@ -68,7 +68,8 @@ global_size = (nwork_groups * work_group_size,)
 local_size  = (work_group_size,)
 localmem    = cl.LocalMem(Float32, work_group_size)
 
-clcall(pi_kernel, Tuple{Int32, Float32, CLPtr{Float32}, CLPtr{Float32}},
+clcall(
+    pi_kernel, Tuple{Int32, Float32, CLPtr{Float32}, CLPtr{Float32}},
        niters, step_size, localmem, d_partial_sums; global_size, local_size)
 
 cl.copy!(h_psum, d_partial_sums)
diff --git a/examples/hands_on_opencl/exA/pi_vocl.jl b/examples/hands_on_opencl/exA/pi_vocl.jl
index 9726d26..fc81301 100644
--- a/examples/hands_on_opencl/exA/pi_vocl.jl
+++ b/examples/hands_on_opencl/exA/pi_vocl.jl
@@ -107,7 +107,8 @@ global_size = (nwork_groups * work_group_size,)
 local_size  = (work_group_size,)
 localmem    = cl.LocalMem(Float32, work_group_size)
 
-clcall(pi_kernel, Tuple{Int32, Float32, CLPtr{Float32}, CLPtr{Float32}},
+clcall(
+    pi_kernel, Tuple{Int32, Float32, CLPtr{Float32}, CLPtr{Float32}},
        niters, step_size, localmem, d_partial_sums; global_size, local_size)
 
 cl.copy!(h_psum, d_partial_sums)

@codecov
Copy link

codecov bot commented Mar 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 72.96%. Comparing base (2d33a31) to head (e917e3f).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #293   +/-   ##
=======================================
  Coverage   72.96%   72.96%           
=======================================
  Files          12       12           
  Lines         614      614           
=======================================
  Hits          448      448           
  Misses        166      166           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@maleadt maleadt merged commit 537b118 into JuliaGPU:master Mar 24, 2025
3 of 6 checks passed
@blegat blegat mentioned this pull request Mar 28, 2025
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

Successfully merging this pull request may close these issues.

2 participants