# Introduction to oneAPI.jl

**URL:** https://discourse.julialang.org/t/introduction-to-oneapi-jl/51054
**Category:** GPU
**Tags:** announcement, gpu, oneapi
**Created:** [December 1, 2020, 4:48pm UTC](https://discourse.julialang.org/t/introduction-to-oneapi-jl/51054 "2020-12-01T16:48:29Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![vchuravy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vchuravy/32/8_2.png) [@vchuravy](https://discourse.julialang.org/u/vchuravy)
#### Post date: [December 1, 2020, 4:48pm UTC](https://discourse.julialang.org/t/introduction-to-oneapi-jl/51054/1 "2020-12-01T16:48:29Z")

</div>

@maleadt is going to give a short introduction to his recent work on [oneAPI.jl](https://github.com/JuliaGPU/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](https://julialang.org/community/#events).

---

<div class="post-metadata">

### Author: ![LaurentPlagne](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/laurentplagne/32/10103_2.png) [@LaurentPlagne](https://discourse.julialang.org/u/LaurentPlagne)
#### Post date: [December 1, 2020, 9:21pm UTC](https://discourse.julialang.org/t/introduction-to-oneapi-jl/51054/2 "2020-12-01T21:21:06Z")

</div>

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:

```julia
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 :

```julia
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 😉  
Anyway, Kudo again to @maleadt for his outstanding work !!

---

<div class="post-metadata">

### Author: ![vchuravy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vchuravy/32/8_2.png) [@vchuravy](https://discourse.julialang.org/u/vchuravy)
#### Post date: [December 7, 2020, 6:10pm UTC](https://discourse.julialang.org/t/introduction-to-oneapi-jl/51054/3 "2020-12-07T18:10:48Z")

</div>

The talk recording is available at [[JuliaGPU] A brief introduction to oneAPI.jl by Dr. Tim Besard - YouTube](https://www.youtube.com/watch?v=LQuI2nWvEK4)
