Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion examples/histogram.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# INCLUDE ROCM
using KernelAbstractions, Test
using KernelAbstractions: @atomic, @atomicswap, @atomicreplace
import KernelAbstractions.KernelIntrinsics as KI
import KernelAbstractions.KernelInterface as KI

include(joinpath(dirname(pathof(KernelAbstractions)), "../examples/utils.jl")) # Load backend

Expand Down
2 changes: 1 addition & 1 deletion examples/performant_matmul.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using KernelAbstractions
import KernelAbstractions.KernelIntrinsics as KI
import KernelAbstractions.KernelInterface as KI

using StaticArrays
using Test
Expand Down
6 changes: 3 additions & 3 deletions src/KernelAbstractions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,9 @@ Abstract type for all KernelAbstractions backends.
"""
abstract type Backend end

include("intrinsics.jl")
import .KernelIntrinsics as KI
export KernelIntrinsics
include("interface.jl")
import .KernelInterface as KI
export KernelInterface

###
# Kernel language
Expand Down
10 changes: 5 additions & 5 deletions src/intrinsics.jl → src/interface.jl
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
"""
# `KernelIntrinsics`
# `KernelInterface`

The `KernelIntrinsics` (or `KI`) module defines the API interface for backends to define various lower-level device and
host-side functionality. The `KI` intrinsics are used to define the higher-level device-side
intrinsics functionality in `KernelAbstractions`.
The `KernelInterface` (or `KI`) module defines the API interface for backends to define various lower-level device and
host-side functionality. The `KI` interface is used to define the higher-level device-side
functionality in `KernelAbstractions`.

Both provide APIs for host and device-side functionality, but `KI` focuses on on lower-level
functionality that is shared amongst backends, while `KernelAbstractions` provides higher-level functionality
such as writing kernels that work on arrays with an arbitrary number of dimensions, or convenience functions
like allocating arrays on a backend.
"""
module KernelIntrinsics
module KernelInterface

import ..KernelAbstractions: Backend
import GPUCompiler: split_kwargs, assign_args!
Expand Down
2 changes: 1 addition & 1 deletion src/pocl/backend.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ using ..POCL: @device_override, cl, method_table
using ..POCL: device, clconvert, clfunction

import KernelAbstractions as KA
import KernelAbstractions.KernelIntrinsics as KI
import KernelAbstractions.KernelInterface as KI

import StaticArrays

Expand Down
12 changes: 6 additions & 6 deletions test/intrinsics.jl → test/interface.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import KernelAbstractions.KernelIntrinsics as KI
import KernelAbstractions.KernelInterface as KI

struct KernelData
global_size::Int
Expand All @@ -8,7 +8,7 @@ struct KernelData
num_groups::Int
group_id::Int
end
function test_intrinsics_kernel(results)
function test_interface_kernel(results)
i = KI.get_global_id().x

if i <= length(results)
Expand All @@ -24,8 +24,8 @@ function test_intrinsics_kernel(results)
return
end

function intrinsics_testsuite(backend, AT)
@testset "KernelIntrinsics Tests" begin
function interface_testsuite(backend, AT)
@testset "KernelInterface Tests" begin
@testset "Launch parameters" begin
# 1d
function launch_kernel1d(arr)
Expand Down Expand Up @@ -80,7 +80,7 @@ function intrinsics_testsuite(backend, AT)
@test_throws ArgumentError (KI.@kernel backend() numworkgroups = (2, 2, 2) workgroupsize = (2, 2, 2, 2) launch_kernel3d(arr3d))
end

@testset "Basic intrinsics functionality" begin
@testset "Basic interface functionality" begin

@test KI.max_work_group_size(backend()) isa Int
@test KI.multiprocessor_count(backend()) isa Int
Expand All @@ -90,7 +90,7 @@ function intrinsics_testsuite(backend, AT)
numworkgroups = 4
N = workgroupsize * numworkgroups
results = AT(Vector{KernelData}(undef, N))
kernel = KI.@kernel backend() launch = false test_intrinsics_kernel(results)
kernel = KI.@kernel backend() launch = false test_interface_kernel(results)

@test KI.kernel_max_work_group_size(kernel) isa Int
@test KI.kernel_max_work_group_size(kernel; max_work_items = 1) == 1
Expand Down
8 changes: 4 additions & 4 deletions test/testsuite.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Testsuite

using ..KernelAbstractions
import ..KernelAbstractions.KernelIntrinsics as KI
import ..KernelAbstractions.KernelInterface as KI
using ..Test

# We can't add test-dependencies withouth breaking backend packages
Expand All @@ -27,7 +27,7 @@ end


include("test.jl")
include("intrinsics.jl")
include("interface.jl")
include("localmem.jl")
include("private.jl")
include("unroll.jl")
Expand All @@ -50,8 +50,8 @@ function testsuite(backend, backend_str, backend_mod, AT, DAT; skip_tests = Set{
specialfunctions_testsuite(backend)
end

@conditional_testset "Intrinsics" skip_tests begin
intrinsics_testsuite(backend, AT)
@conditional_testset "Interface" skip_tests begin
interface_testsuite(backend, AT)
end

@conditional_testset "Localmem" skip_tests begin
Expand Down
Loading