Brahma.FSharp
2.0.0
See the version list below for details.
dotnet add package Brahma.FSharp --version 2.0.0
NuGet\Install-Package Brahma.FSharp -Version 2.0.0
<PackageReference Include="Brahma.FSharp" Version="2.0.0" />
paket add Brahma.FSharp --version 2.0.0
#r "nuget: Brahma.FSharp, 2.0.0"
// Install Brahma.FSharp as a Cake Addin #addin nuget:?package=Brahma.FSharp&version=2.0.0 // Install Brahma.FSharp as a Cake Tool #tool nuget:?package=Brahma.FSharp&version=2.0.0
Brahma.FSharp
Brahma.FSharp provides a way to utilize GPGPU in your F# programs. It is based on F# quotations to OpenCL translation.
Features
- Utilization of OpenCL for communication with GPU. So, you can work not only with NVIDIA devices but with any device which supports OpenCL (e.g. with AMD ot Intel devices).
- Not only primitive types, but also discriminated unions, structs, records are supported.
- Pattern matching, mutable and immutable bindings, nested bindings are supported.
- Custom atomics.
- Fine-grained memory management and kernels compilation process.
- Mailbox processor based interface for communication with devices.
More details are available here.
Installation
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.
Quick Start
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
Contributing
Contributions, issues and feature requests are welcome. Feel free to check issues page if you want to contribute.
Build
Make sure the following requirements are installed on your system:
- dotnet SDK 5.0 or higher
- OpenCL-compatible device and respective OpenCL driver
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.
License
This project licensed under EPL-1.0 License. License text can be found in the license file.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 is compatible. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net5.0
- Brahma.FSharp.OpenCL.Printer (>= 2.0.0)
- Brahma.FSharp.OpenCL.Shared (>= 2.0.0)
- Brahma.FSharp.OpenCL.Translator (>= 2.0.0)
- FSharp.Core (>= 5.0.1)
- FSharp.Quotations.Evaluator (>= 2.1.0)
- YC.OpenCL.NET (>= 2.0.0)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Brahma.FSharp:
Package | Downloads |
---|---|
Brahman.Substrings
Brahman is a set of snippets, algorithms and solution for end users based on Brahma.FSharp. Brahman.Substrings is a library for substrings matching." |
|
Brahma.FSharp.OpenCL.WorkflowBuilder
Brahma.FSharp does the thing! |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
3.0.0-alpha1.5 | 179 | 4/17/2024 |
3.0.0-alpha1.3 | 67 | 4/12/2024 |
3.0.0-alpha1.2 | 55 | 4/12/2024 |
3.0.0-alpha1.1 | 62 | 4/9/2024 |
2.0.5 | 2,092 | 2/10/2023 |
2.0.4 | 364 | 1/13/2023 |
2.0.3 | 525 | 1/4/2023 |
2.0.2 | 311 | 12/28/2022 |
2.0.1 | 3,179 | 8/5/2022 |
2.0.0 | 483 | 7/5/2022 |
2.0.0-alpha9.6 | 201 | 6/3/2022 |
2.0.0-alpha9.5 | 155 | 5/7/2022 |
2.0.0-alpha9.4 | 153 | 4/8/2022 |
2.0.0-alpha9.3 | 146 | 3/24/2022 |
2.0.0-alpha9.2 | 1,356 | 11/26/2021 |
2.0.0-alpha9.1 | 324 | 10/16/2021 |
2.0.0-alpha9 | 255 | 10/15/2021 |
2.0.0-alpha8 | 259 | 9/27/2021 |
2.0.0-alpha7.1 | 186 | 7/18/2021 |
2.0.0-alpha7 | 324 | 5/19/2021 |
2.0.0-alpha6.2 | 232 | 5/19/2021 |
2.0.0-alpha6.1 | 278 | 3/22/2021 |
2.0.0-alpha6 | 250 | 3/22/2021 |
2.0.0-alpha5 | 414 | 1/27/2021 |
2.0.0-alpha4 | 384 | 12/27/2020 |
2.0.0-alpha3 | 345 | 11/27/2020 |
2.0.0-alpha2 | 372 | 11/11/2020 |
1.1.5 | 1,556 | 11/10/2017 |
1.1.4 | 994 | 11/2/2017 |
1.1.3 | 1,102 | 7/16/2017 |
1.1.2 | 1,083 | 7/5/2017 |
1.1.1 | 1,056 | 7/5/2017 |
1.1.0 | 1,055 | 6/21/2017 |
1.1.0-alpha4 | 824 | 5/30/2017 |
1.1.0-alpha3 | 893 | 5/9/2017 |
1.1.0-alpha2 | 817 | 5/9/2017 |
1.1.0-alpha1 | 947 | 5/6/2017 |
1.0.1 | 1,891 | 7/15/2016 |
1.0.0 | 1,242 | 7/14/2016 |
0.3.5 | 1,932 | 6/27/2014 |
0.3.0.1 | 1,226 | 6/18/2014 |
0.2.4 | 2,191 | 3/28/2014 |
0.2.3 | 1,323 | 3/14/2014 |
0.2.2 | 1,313 | 3/11/2014 |
0.2.0 | 2,780 | 12/2/2013 |
0.1.4992 | 1,343 | 9/2/2013 |
0.1.4989 | 1,298 | 8/30/2013 |
0.1.4926 | 2,304 | 6/28/2013 |
0.0.0.3 | 1,438 | 6/28/2013 |
0.0.0.2 | 1,406 | 5/31/2013 |
0.0.0.1 | 1,363 | 5/30/2013 |
## [2.0.0] - 2022-07-05
[2.0.0]: https://github.com/YaccConstructor/Brahma.FSharp/compare/v1.1.5...v2.0.0
### Fixed
- Blittable types transfer
- Performance issues
- Pointers to private variables are explicitly private
- Performance of blittable types
- Performance of kernels creation
- Issue #135
- Native opencl library linking
- Atomics
- ClArray memory management
- API for buffers manipulation
- Boolean type support (issue ##116, https://github.com/YaccConstructor/Brahma.FSharp/issues/116)
- Nested functions
- Complex let bindings
- ToHost behaviour on non-gpu arrays
- printf/printfn without arguments
- Boolean binary operators
- Transfer arrays of boolean
- Local memory semantic. It is forbidden to initialize variables in the local memory.
- Blittable types transfer
- Performance issues
- Pointers to private variables are explicitly private
- Performance of blittable types
- Performance of kernels creation
- Issue #135
- Native opencl library linking
- Atomics
- ClArray memory management
- API for buffers manipulation
- Boolean type support (issue ##116, https://github.com/YaccConstructor/Brahma.FSharp/issues/116)
- Nested functions
- Complex let bindings
- ToHost behaviour on non-gpu arrays
- printf/printfn without arguments
- Boolean binary operators
- Transfer arrays of boolean
- Local memory semantic. It is forbidden to initialize variables in the local memory.
### Added
- New abstraction for OpenCL device
- Getting workGroupSize inside kernels
- Discriminated unions inside kernel functions
- Stepped and non-integer loops
- ```ClCell``` support
- support of following types
- ```Tuple``` and ```ValueTuple```
- Records including generic records
- Workflow builder for OpenCL computations
- New mailbox processor based API
- Targeting .net 5.0
- Kernel compilation caching
- Mutable variables in closures
- support of printf call inside kernel code
- While and for loops in workflow builders
- Basic workflow builders for designing computations
- New abstraction for OpenCL device
- Getting workGroupSize inside kernels
- Discriminated unions inside kernel functions
- Stepped and non-integer loops
- ```ClCell``` support
- support of following types
- ```Tuple``` and ```ValueTuple```
- Records including generic records
- Workflow builder for OpenCL computations
- New mailbox processor based API
- Targeting .net 5.0
- Kernel compilation caching
- Mutable variables in closures
- support of printf call inside kernel code
- While and for loops in workflow builders
- Basic workflow builders for designing computations