Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/oblivious-oblivious/crystal-omp
C bindings for OpenMP.
https://github.com/oblivious-oblivious/crystal-omp
Last synced: 8 days ago
JSON representation
C bindings for OpenMP.
- Host: GitHub
- URL: https://github.com/oblivious-oblivious/crystal-omp
- Owner: Oblivious-Oblivious
- License: mit
- Created: 2024-04-07T20:31:38.000Z (9 months ago)
- Default Branch: master
- Last Pushed: 2024-04-10T07:06:32.000Z (9 months ago)
- Last Synced: 2024-04-11T07:29:23.313Z (9 months ago)
- Language: Crystal
- Homepage:
- Size: 8.2 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# crystal-omp
OpenMP integration for Crystal. Supported up to latest version.
## Installation
1. Add the dependency to your `shard.yml`:
```yaml
dependencies:
crystal-omp:
github: Oblivious-Oblivious/crystal-omp
```2. Run `shards install`
## Usage
```crystal
require "crystal-omp"
```Try [examples](https://github.com/Oblivious-Oblivious/crystal-omp/tree/master/examples) for more.
*`cat function.c`*
```c
int run_in_c(char *value) {
#pragma omp parallel
for(;;);
printf("%s\n", value);
return 42;
}
```*`cat test.cr`*
```cr
@[Link(ldflags: "#{__DIR__}/function.o")]
lib LibTest
fun run_in_c(LibC::Char*) : LibC::Int;
endres = LibTest.run_in_c "somestring";
pp res;
``````bash
clang -fopenmp -o function.o function.c
crystal test.cr
```## Development
1. Tests for binded functionality
2. Wrapper objects for converting safe values to unsafe ones## Contributing
1. Fork it ()
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request## Contributors
- [Oblivious](https://github.com/Oblivious-Oblivious) - creator and maintainer