IntelLabs / ParallelAccelerator.jl

The ParallelAccelerator package, part of the High Performance Scripting project at Intel Labs
BSD 2-Clause "Simplified" License
294 stars 32 forks source link

Simple example failing #71

Closed malmaud closed 8 years ago

malmaud commented 8 years ago

   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "?help" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.4.3 (2016-01-12 21:37 UTC)
 _/ |\__'_|_|_|\__'_|  |  Official http://julialang.org/ release
|__/                   |  x86_64-apple-darwin13.4.0

julia> using ParallelAccelerator

julia> @acc f(x)=x./sum(x.^2)
f (generic function with 1 method)

julia> f([1,2])
OpenMP is not used.
2-element Array{Float64,1}:
 0.0
 0.0

This is using the current ParallelAccelerator master (8e0485a0db2d8a36237b35ecbe63a28aadea8ec6)

ninegua commented 8 years ago

There are several issues involved here. I'll fix the Int to Float coercion with operator ./. But meanwhile, even f(x)=x.+sum(x.^2) would give wrong result, and only becomes correct when fusion is off. @DrTodd13 can you help looking into it?

DrTodd13 commented 8 years ago

Fixed in 6089b68.

malmaud commented 8 years ago

Thanks!