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

Add a set of co-proccesor constraint_setting (feature request) #23

Open
nathaniel-brough opened this issue Jan 14, 2021 · 1 comment
Open
Labels
feature request P4 This is either out of scope or we don't have bandwidth to review a PR. (No assignee)

Comments

@nathaniel-brough
Copy link
Contributor

This is a similar suggestion to #13 but more generic and could include other secondary processors. This could include fpu's, gpgpu's, ai proccesors, simd extensions, dsp extensions, fpga's etc.

An example of this might look like;

coproccesor/BUILD

licenses(["notice"])
package(
    default_visibility = ["//visibility:public"],
)

constraint_setting(name = "fpu")

# Cortex-M4 optional fpu
constraint_value(
    name = "VFPv4_SP", 
    constraint_setting = ":fpu",
)

# Cortex-M7 optional fpu
constraint_value(
    name = "VFPv5_D16", 
    constraint_setting = ":fpu",
)

constraint_setting(name="dsp")

constraint_value(
    name = "cortex_m_dsp", 
    constraint_setting = ":dsp",
)

constraint_setting(name="ai")

constraint_value(
    name = "coral_edge_tpu", 
    constraint_setting = ":ai",
)

constraint_setting(name="gpgpu")

constraint_value(
    name = "amd-opencl", 
    constraint_setting = ":gpgpu",
)

constraint_value(
    name = "nvidia-cuda", 
    constraint_setting = ":gpgpu",
)

There is one caveat with using bazel platforms/constraint settings here and that is if you had a device that could support two constraint_values for a given constraint_setting. Say that you put a "AMD" and a "nvidia" gpgpu into a device you couldn't specify multiple values for the 'gpgpu' constraint_setting. This could be a common recurring problem, specifically with integrated+dedicated gpgpu devices.

@aiuto aiuto added P4 This is either out of scope or we don't have bandwidth to review a PR. (No assignee) feature request and removed untriaged labels Apr 11, 2022
@aiuto
Copy link
Contributor

aiuto commented Apr 11, 2022

For the same reasons as #13, this is not something we would support.

@aiuto aiuto removed their assignment Apr 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request P4 This is either out of scope or we don't have bandwidth to review a PR. (No assignee)
Projects
None yet
Development

No branches or pull requests

3 participants