Introduction to oneAPI.jl

@maleadt is going to give a short introduction to his recent work on oneAPI.jl at the next virtual JuliaGPU user call.

The next user call is at Mon, December 7, 17:00 – 18:00 UTC and the details on how to join can be found on the Julia community calendar.

10 Likes

That is great !
I will give a short talk during an Intel oneAPI webinar (in french) in 2 days where I will introduce oneAPI.jl. The comparison between Julia and C++ is rather interesting for the following example:

using oneAPI# package Julia (new)

#x init
n = 10 ; x=rand(Float32,n) .- 0.5f0  # Array on CPU
xone=oneArray(x) # Array on GPU

res=mapreduce(abs,max,xone)  #Array on GPU

Compared to :

template <typename Policy>
float absmax(std::vector<float> & X,Policy & policy){
  const int N = X.size();
  buffer<float, 1> X_buf{X.data(),range<1>(N)};
  float result = std::transform_reduce(
      policy,
      oneapi::dpl::begin(X_buf),
      oneapi::dpl::end(X_buf),
      0.0f,
      [](float a, float b) { return std::max(a, b); },
      [](float x) { return abs(x); });
  return result;
}


int main()
{
  // X array init
  const int N = 10000000;
  std::vector<float> X(N);
  //Here I skip the random init in C++  ...

  auto policy = oneapi::dpl::execution::make_device_policy(
      queue(default_selector{}, 
      dpc_common::exception_handler));

  float result = absmax(X, policy);
}

Maybe suitable for the Julia/C++ comparison thread :wink:
Anyway, Kudo again to @maleadt for his outstanding work !!

8 Likes

The talk recording is available at [JuliaGPU] A brief introduction to oneAPI.jl by Dr. Tim Besard - YouTube

1 Like