Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set CF_CUDA_ENABLED=True if compiler('cuda') is detected in meta.yaml #1544

Merged
merged 8 commits into from
Nov 16, 2021
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions conda_smithy/configure_feedstock.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from itertools import product, chain
import logging
import os
import re
import subprocess
import textwrap
import yaml
Expand Down Expand Up @@ -588,6 +589,17 @@ def _render_ci_provider(
if ver:
os.environ["DEFAULT_LINUX_VERSION"] = ver

# detect if `compiler('cuda')` is used in meta.yaml,
# and set appropriate environment variable
with open(
os.path.join(forge_dir, forge_config["recipe_dir"], "meta.yaml")
) as f:
meta_lines = f.readlines()
isuruf marked this conversation as resolved.
Show resolved Hide resolved
for ml in meta_lines:
# looking for `compiler('cuda')` with both quote variants
if re.match(r"compiler\((\"cuda\"|\'cuda\')\)", ml):
os.environ["CF_CUDA_ENABLED"] = "True"
h-vetinari marked this conversation as resolved.
Show resolved Hide resolved

config = conda_build.config.get_or_merge_config(
None,
exclusive_config_file=forge_config["exclusive_config_file"],
Expand Down