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

BUG: default execution space doesn't affect empty view creation #186

Open
tylerjereddy opened this issue Mar 19, 2023 · 0 comments
Open
Labels
bug Something isn't working

Comments

@tylerjereddy
Copy link
Contributor

This is interfering with my ability to get CUDA/GPU benchmarks for gh-146 and needs a regression test + fix added.

Reproducer is below, where both views need to be allocated to Device memory, otherwise control flows will not make sense at all--you can't have a global execution space default that cherry-picks the scenarios where it respects where things are being allocated, in the absence of an explicit specification to use the host.

import numpy as np
import pykokkos as pk


def main():
    C = pk.View([8, 8], dtype=pk.double)
    print("C.space:", C.space)  # MemorySpace.HostSpace

    a = np.ones((4, 4), dtype=float)
    view_a = pk.from_numpy(a)
    print("view_a.space:", view_a.space) # MemorySpace.CudaSpace


if __name__ == "__main__":
    space = pk.ExecutionSpace.Cuda
    pk.set_default_space(space)
    main()
@tylerjereddy tylerjereddy added the bug Something isn't working label Mar 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant