Add formatter
Some checks failed
Test / test (push) Has been cancelled

This commit is contained in:
2023-08-25 10:48:22 +02:00
parent dbcd569967
commit ae1345d547
44 changed files with 1191 additions and 865 deletions

View File

@@ -1,14 +1,14 @@
function compute(t::AbstractTask; data...)
error("Need to implement compute()")
return error("Need to implement compute()")
end
function compute_effort(t::AbstractTask)
# default implementation using compute
error("Need to implement compute_effort()")
# default implementation using compute
return error("Need to implement compute_effort()")
end
function data(t::AbstractTask)
error("Need to implement data()")
return error("Need to implement data()")
end
compute_effort(t::AbstractDataTask) = 0
@@ -18,16 +18,16 @@ data(t::AbstractDataTask) = getfield(t, :data)
data(t::AbstractComputeTask) = 0
function compute_effort(t::FusedComputeTask)
(T1, T2) = collect(typeof(t).parameters)
return compute_effort(T1()) + compute_effort(T2())
(T1, T2) = collect(typeof(t).parameters)
return compute_effort(T1()) + compute_effort(T2())
end
# actual compute functions for the tasks can stay undefined for now
# compute(t::ComputeTaskU, data::Any) = mycomputation(data)
function compute_intensity(t::AbstractTask)::UInt64
if data(t) == 0
return typemax(UInt64)
end
return compute_effort(t) / data(t)
end
if data(t) == 0
return typemax(UInt64)
end
return compute_effort(t) / data(t)
end