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

create functions of Pelemay options #101

Open
zacky1972 opened this issue Feb 7, 2020 · 0 comments
Open

create functions of Pelemay options #101

zacky1972 opened this issue Feb 7, 2020 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@zacky1972
Copy link
Collaborator

zacky1972 commented Feb 7, 2020

Would you implement to select whether CPU or GPU executes the code?

There are two functions: Pelemay.to_gpu/1 and Pelemay.to_cpu/1.

They are defined as follows:

defmodule Pelemay
  def to_gpu(list), do: list
  def to_cpu(list), do: list
end

In defpelemay, Pelemay.to_gpu/1 and Pelemay.to_cpu/1 will work as follows:

defpelemay do
  def func1(list) do
    list
    |> Enum.map(& &1 + 1) # this code will be run on CPU.
    |> Pelemay.to_gpu()
    |> Enum.map(& &1 * 2) # this code will be run on GPU.
    # the return value will be returned to CPU.
  end
  def func2(list) do
    list
    |> Enum.map(& &1 + 1) # this code will be run on CPU.
    |> Pelemay.to_gpu()
    |> Enum.map(& &1 * 2) # this code will be run on GPU.
    |> Pelemay.to_cpu()
    |> Enum.map(& &1 + 1) # this code will be run on CPU.
  end
end

This issue scope is only to create hooks.

The branch name is pelemay_options

@zacky1972 zacky1972 added the enhancement New feature or request label Feb 7, 2020
@zacky1972 zacky1972 added this to the 0.1.0 milestone Feb 7, 2020
@zacky1972 zacky1972 modified the milestones: 0.1.0, 0.0.7 Feb 17, 2020
@zacky1972 zacky1972 removed this from the 0.0.7 milestone Mar 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants