From 99bfd1ec4315bcad238f97a44bf3172fcdafa303 Mon Sep 17 00:00:00 2001 From: James Date: Thu, 7 Sep 2017 17:48:22 -0400 Subject: [PATCH] Add CPUProcesses (#9) --- src/ComputationalResources.jl | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/ComputationalResources.jl b/src/ComputationalResources.jl index 70e754f..bbb31c4 100644 --- a/src/ComputationalResources.jl +++ b/src/ComputationalResources.jl @@ -75,6 +75,27 @@ end CPUThreads() = CPUThreads(nothing) CPUThreads(r::AbstractResource) = CPUThreads(r.settings) +""" + CPUProcesses() + CPUProcesses(settings) + +Indicate that a computation should be performed using the CPU in multi-process mode. +Processes should be added with addprocs() or julia started with `julia -p N`. +Processes must communicate using distributed memory operations such as remote refrences. +Optionally pass in an object specifying algorithmic settings. + +# Examples: +```julia +filter(CPUProcesses(), image, kernel) +filter(CPUProcesses(TileSize(64,8)), image, kernel) +``` +""" +immutable CPUProcesses{T} <: AbstractCPU{T} + settings::T +end +CPUProcesses() = CPUProcesses(nothing) +CPUProcesses(r::AbstractResource) = CPUProcesses(r.settings) + """ ArrayFireLibs() ArrayFireLibs(settings)