vlang / vsl

V library to develop Artificial Intelligence and High-Performance Scientific Computations
https://vlang.github.io/vsl
MIT License
351 stars 44 forks source link

Fix opencl usage and example compilation on macOS #185

Closed ttytm closed 11 months ago

ttytm commented 11 months ago

This PR should fix opencl usage on macOS.

Now it should be possible to run the opencl examples that used to fail macos. They run locally tested on my mac machine.

But I think the example compilation via the script is false positive. E.g., on my linux main machine I can compile the opencl examples but it's not possible to run them.

I'd address a CI improvement in a separate PR.

Summary by CodeRabbit

Please note, these changes may not directly impact the user interface but contribute to the overall performance and reliability of our software.

coderabbitai[bot] commented 11 months ago

Walkthrough

This pull request introduces changes to the CI/CD pipeline, compilation process, and platform-specific code adjustments for Apple systems. The modifications aim to enhance the project's compatibility with OpenCL libraries and Apple platforms, and to include examples in the test suite.

Changes

File Summary
.github/workflows/ci.yml Adds a step to install opencl-headers using Homebrew and removes --skip-examples flag from test commands.
bin/test Adds -d dlopencl flag to the compilation command, likely related to dynamic loading of OpenCL libraries.
vcl/vcl.h Changes the preprocessor directive from #ifdef DARWIN to #ifdef __APPLE__ for better compatibility with Apple systems.

🐇💻

In the land of code, where the shadows lie,

A rabbit hops, under the cloudless sky.

With each hop, a change is made,

In the realm of OpenCL, a foundation is laid.

Tests now run, with examples in sight,

And Apple systems bask in the new light.

So, let's celebrate this code, so fine,

For in the land of GitHub, it's pull request time! 🎉


Tips ### Chat with CodeRabbit Bot (`@coderabbitai`) - If you reply to a *review comment* from CodeRabbit, the bot will automatically respond. - To engage with CodeRabbit bot directly around the specific lines of code in the PR, mention @coderabbitai in your review comment - Note: Review comments are made on code diffs or files, not on the PR overview. - Add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed. ### CodeRabbit Commands (invoked as PR comments) - `@coderabbitai pause` to pause the reviews on a PR. - `@coderabbitai resume` to resume the paused reviews. - `@coderabbitai review` to trigger a review. This is useful when automatic reviews are disabled for the repository. - `@coderabbitai help` to get help. Note: For conversation with the bot, please use the review comments on code diffs or files. ### CodeRabbit Configration File (`.coderabbit.yaml`) - You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository. - The JSON schema for the configuration file is available [here](https://coderabbit.ai/integrations/coderabbit-overrides.json). - If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.json`