Update docs
This commit is contained in:
@@ -50,6 +50,12 @@ function gen_code(graph::DAG, machine::Machine)
|
||||
return (code = Expr(:block, code...), inputSymbols = inputSyms, outputSymbol = outSym)
|
||||
end
|
||||
|
||||
function gen_cache_init_code(machine::Machine)
|
||||
initializeCaches = Vector{Expr}()
|
||||
|
||||
return initializeCaches
|
||||
end
|
||||
|
||||
function gen_input_assignment_code(
|
||||
inputSymbols::Dict{String, Vector{Symbol}},
|
||||
processDescription::AbstractProcessDescription,
|
||||
|
@@ -1,5 +1,10 @@
|
||||
using CUDA
|
||||
|
||||
"""
|
||||
CUDAGPU <: AbstractGPU
|
||||
|
||||
Representation of a specific CUDA GPU that code can run on. Implements the [`AbstractDevice`](@ref) interface.
|
||||
"""
|
||||
mutable struct CUDAGPU <: AbstractGPU
|
||||
device::Any # TODO: what's the cuda device type?
|
||||
cacheStrategy::CacheStrategy
|
||||
|
@@ -1,4 +1,3 @@
|
||||
|
||||
"""
|
||||
device_types()
|
||||
|
||||
@@ -13,7 +12,7 @@ end
|
||||
"""
|
||||
strategies(t::Type{T}) where {T <: AbstractDevice}
|
||||
|
||||
Return a vector of available [`CacheStrategy`](@ref)s for the given [`AbstarctDevice`](@ref).
|
||||
Return a vector of available [`CacheStrategy`](@ref)s for the given [`AbstractDevice`](@ref).
|
||||
The caching strategies are used in code generation.
|
||||
"""
|
||||
function strategies(t::Type{T}) where {T <: AbstractDevice}
|
||||
|
@@ -33,7 +33,22 @@ See also: [`strategies`](@ref)
|
||||
"""
|
||||
abstract type CacheStrategy end
|
||||
|
||||
"""
|
||||
LocalVariables <: CacheStrategy
|
||||
|
||||
A caching strategy relying solely on local variables for every input and output.
|
||||
|
||||
Implements the [`CacheStrategy`](@ref) interface.
|
||||
"""
|
||||
struct LocalVariables <: CacheStrategy end
|
||||
|
||||
"""
|
||||
Dictionary <: CacheStrategy
|
||||
|
||||
A caching strategy relying on a dictionary of Symbols to store every input and output.
|
||||
|
||||
Implements the [`CacheStrategy`](@ref) interface.
|
||||
"""
|
||||
struct Dictionary <: CacheStrategy end
|
||||
|
||||
"""
|
||||
@@ -79,7 +94,7 @@ function measure_device! end
|
||||
"""
|
||||
gen_cache_init_code(device::AbstractDevice, strategy::CacheStrategy)
|
||||
|
||||
Interface function that must be implemented for every subtype of [`AbstractDevice`](@ref) and at least one [`CacheStrategy`](@ref). Returns an [`Expr`](@ref) initializing this device's variable cache.
|
||||
Interface function that must be implemented for every subtype of [`AbstractDevice`](@ref) and at least one [`CacheStrategy`](@ref). Returns an `Expr` initializing this device's variable cache.
|
||||
|
||||
The strategy is a symbol
|
||||
"""
|
||||
|
@@ -1,5 +1,10 @@
|
||||
using NumaAllocators
|
||||
|
||||
"""
|
||||
NumaNode <: AbstractCPU
|
||||
|
||||
Representation of a specific CPU that code can run on. Implements the [`AbstractDevice`](@ref) interface.
|
||||
"""
|
||||
mutable struct NumaNode <: AbstractCPU
|
||||
numaId::UInt16
|
||||
threads::UInt16
|
||||
|
@@ -1,5 +1,10 @@
|
||||
using oneAPI
|
||||
|
||||
"""
|
||||
oneAPIGPU <: AbstractGPU
|
||||
|
||||
Representation of a specific Intel GPU that code can run on. Implements the [`AbstractDevice`](@ref) interface.
|
||||
"""
|
||||
mutable struct oneAPIGPU <: AbstractGPU
|
||||
device::Any
|
||||
cacheStrategy::CacheStrategy
|
||||
|
@@ -1,5 +1,10 @@
|
||||
using AMDGPU
|
||||
|
||||
"""
|
||||
ROCmGPU <: AbstractGPU
|
||||
|
||||
Representation of a specific AMD GPU that code can run on. Implements the [`AbstractDevice`](@ref) interface.
|
||||
"""
|
||||
mutable struct ROCmGPU <: AbstractGPU
|
||||
device::Any
|
||||
cacheStrategy::CacheStrategy
|
||||
|
@@ -49,7 +49,7 @@ Generate and return code for a given [`ComputeTaskNode`](@ref).
|
||||
"""
|
||||
function get_expression(node::ComputeTaskNode, device::AbstractDevice)
|
||||
t = typeof(node.task)
|
||||
@assert length(node.children) >= children(node.task) "Node $(node) has too few children for its task: node has $(length(node.children)) versus task has $(children(node.task))\nNode's children: $(getfield.(node.children, :children))"
|
||||
@assert length(node.children) <= children(node.task) "Node $(node) has too many children for its task: node has $(length(node.children)) versus task has $(children(node.task))\nNode's children: $(getfield.(node.children, :children))"
|
||||
|
||||
# TODO get device from the node
|
||||
cacheStrategy = cache_strategy(device)
|
||||
|
Reference in New Issue
Block a user