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

Run Runic after explicit return rule addition #516

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

fredrikekre
Copy link
Contributor

No description provided.

@@ -266,6 +266,7 @@ function unittest_testsuite(Backend, backend_str, backend_mod, BackendArrayT; sk
function f(KernelAbstractions.@context, a)
I = @index(Global, Linear)
a[I] = 1
return # ??
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is this valid? This function isn't defined in a macro, but used just below in a @kernel function...

Copy link
Member

@vchuravy vchuravy Aug 28, 2024

Choose a reason for hiding this comment

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

Yeah, that's valid

@@ -62,13 +62,13 @@ function histogram!(histogram_output, input)
backend = get_backend(histogram_output)
# Need static block size
kernel! = histogram_kernel!(backend, (256,))
kernel!(histogram_output, input, ndrange = size(input))
return kernel!(histogram_output, input, ndrange = size(input))
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
return kernel!(histogram_output, input, ndrange = size(input))
kernel!(histogram_output, input, ndrange = size(input))
return

end

function move(backend, input)
# TODO replace with adapt(backend, input)
out = KernelAbstractions.allocate(backend, eltype(input), size(input))
KernelAbstractions.copyto!(backend, out, input)
return KernelAbstractions.copyto!(backend, out, input)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
return KernelAbstractions.copyto!(backend, out, input)
KernelAbstractions.copyto!(backend, out, input)
return

@@ -22,7 +22,7 @@ function matmul!(output, a, b)
end
backend = KernelAbstractions.get_backend(a)
kernel! = matmul_kernel!(backend)
kernel!(output, a, b, ndrange = size(output))
return kernel!(output, a, b, ndrange = size(output))
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
return kernel!(output, a, b, ndrange = size(output))
kernel!(output, a, b, ndrange = size(output))
return

@@ -12,7 +12,7 @@ function mycopy!(A, B)
@assert get_backend(B) == backend

kernel = copy_kernel!(backend)
kernel(A, B, ndrange = length(A))
return kernel(A, B, ndrange = length(A))
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
return kernel(A, B, ndrange = length(A))
kernel(A, B, ndrange = length(A))
return

@@ -12,7 +12,7 @@ function mycopy_static!(A, B)
@assert get_backend(B) == backend

kernel = copy_kernel!(backend, 32, size(A)) # if size(A) varies this will cause recompilation
kernel(A, B, ndrange = size(A))
return kernel(A, B, ndrange = size(A))
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
return kernel(A, B, ndrange = size(A))
kernel(A, B, ndrange = size(A))
return

@@ -101,6 +101,7 @@ function transform_gpu!(def, constargs, force_inbounds)
Expr(:block, let_constargs...),
body,
)
return def # or nothing?
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
return def # or nothing?
return

@@ -135,6 +136,7 @@ function transform_cpu!(def, constargs, force_inbounds)
Expr(:block, let_constargs...),
Expr(:block, new_stmts...),
)
return def # or nothing?
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
return def # or nothing?
return

@@ -266,6 +266,7 @@ function unittest_testsuite(Backend, backend_str, backend_mod, BackendArrayT; sk
function f(KernelAbstractions.@context, a)
I = @index(Global, Linear)
a[I] = 1
return # ??
Copy link
Member

@vchuravy vchuravy Aug 28, 2024

Choose a reason for hiding this comment

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

Yeah, that's valid

@@ -266,6 +266,7 @@ function unittest_testsuite(Backend, backend_str, backend_mod, BackendArrayT; sk
function f(KernelAbstractions.@context, a)
I = @index(Global, Linear)
a[I] = 1
return # ??
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
return # ??
return

@@ -43,5 +43,5 @@ function unroll_testsuite(backend, ArrayT)
kernel!(a, Val(5))
kernel2! = kernel_unroll2!(backend(), 1, 1)
kernel2!(a)
synchronize(backend())
return synchronize(backend())
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
return synchronize(backend())
synchronize(backend())
return

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