crystal-omp
crystal-omp
OpenMP integration for Crystal. Supported up to latest version.
Installation
-
Add the dependency to your
shard.yml
:dependencies: crystal-omp: github: Oblivious-Oblivious/crystal-omp
-
Run
shards install
Usage
require "crystal-omp"
Try examples for more.
cat function.c
int run_in_c(char *value) {
#pragma omp parallel
for(;;);
printf("%s\n", value);
return 42;
}
cat test.cr
@[Link(ldflags: "#{__DIR__}/function.o")]
lib LibTest
fun run_in_c(LibC::Char*) : LibC::Int;
end
res = LibTest.run_in_c "somestring";
pp res;
clang -fopenmp -o function.o function.c
crystal test.cr
Development
- Tests for binded functionality
- Wrapper objects for converting safe values to unsafe ones
Contributing
- Fork it (https://github.com/Oblivious-Oblivious/crystal-omp/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
Contributors
- Oblivious - creator and maintainer
Repository
crystal-omp
Owner
Statistic
- 0
- 0
- 0
- 0
- 0
- 8 months ago
- April 7, 2024
License
MIT License
Links
Synced at
Sun, 22 Dec 2024 03:35:59 GMT
Languages