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

ndslice integration #14

Open
9il opened this issue Feb 28, 2017 · 7 comments
Open

ndslice integration #14

9il opened this issue Feb 28, 2017 · 7 comments
Labels

Comments

@9il
Copy link
Member

9il commented Feb 28, 2017

Can we use library @nothrow @nogc generic code in kernels. For example Slice!(Contiguous, [1], GlobalPointer!T) and ndslice topology?

@9il 9il added the question label Feb 28, 2017
@thewilsonator
Copy link
Collaborator

Definitely.

  • types and type related operations can be used as is (keeping in mind that initialisers do not yet work).
  • code however will require that the module of origin be marked @compute(CompileFor.hostAndDevice) to work on both the host and device

@9il
Copy link
Member Author

9il commented Feb 28, 2017

code however will require that the module of origin be marked @compute(CompileFor.hostAndDevice) to work on both the host and device

Do you mean mir.ndslice should be marked?

@thewilsonator
Copy link
Collaborator

yes. I think it would be good to have a module (probably in dcompute) that imports all the relevant dcompute symbols from ldc.attributes and ldc.dcomputetypes if version = LDC_DCompute and otherwise sets up proxies for the symbols so you can still compile without a dcompute enabled ldc.

@9il
Copy link
Member Author

9il commented Mar 8, 2017

yes. I think it would be good to have a module (probably in dcompute) that imports all the relevant dcompute symbols from ldc.attributes and ldc.dcomputetypes if version = LDC_DCompute and otherwise sets up proxies for the symbols so you can still compile without a dcompute enabled ldc.

@thewilsonator Why not to allow any generic code to be instantiated in a marked module?

@thewilsonator
Copy link
Collaborator

?? Not sure what you mean. Any modules, regardless of its @compute'ness, can have templates. The section you quoted would be for enabling building with a non-dcompute enabled compiler (e.g. old LDC and DMD/GDC)

@9il
Copy link
Member Author

9il commented Mar 8, 2017

I mean that I do not understand why ndslice should be marked if it is completely generic. If we call a generic function from kernel function it can be automatically determinated that generic should be compiled for kernel

@thewilsonator
Copy link
Collaborator

thewilsonator commented Mar 8, 2017

Actually that might work. I'm not quite sure how template instances end up in a given module's symbol table, but if it does because it is referenced by that module, then the code would suggest that that would work.

We would still need @compute modules that reference them, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants