Brahma.FSharp provides a way to utilize GPGPU in your F# programs. It is based on F# quotations to OpenCL translation.
More details are available here.
Install Brahma.FSharp by running:
dotnet add package Brahma.FSharp
Setup BRAHMA_OCL_PATH environment variable to opencl.dll location if it differs from default.
open Brahma.FSharp
let device = ClDevice.GetFirstAppropriateDevice()
let context = RuntimeContext(device)
let kernel =
<@
fun (range: Range1D) (buffer: int clarray) ->
let gid = range.GlobalID0
buffer.[gid] <- buffer.[gid] + 1
@>
opencl {
use! buffer = ClArray.alloc<int> 1024
do! runCommand kernel <| fun kernel ->
kernel
<| Range1D(1024, 256)
<| buffer
return! ClArray.toHost buffer
}
|> ClTask.runSync context
Contributions, issues and feature requests are welcome. Feel free to check issues page if you want to contribute.
Make sure the following requirements are installed on your system:
To build and run all tests:
on Windows
build.cmd
on Linux/macOS
./build.sh
To find more options look at MiniScaffold. We use it in our project.
The release process is automated: NuGet packages publishing process is triggered by tag pushing to any branch. To release new vesion one should
./build.sh Release [version]
(on local machine)This project licensed under EPL-1.0 License. License text can be found in the license file.