Delite simple test falure

48 views
Skip to first unread message

Alexander Filippov

unread,
Nov 8, 2013, 2:44:49 AM11/8/13
to opt...@googlegroups.com
Hi,
 
I am interested in using Delite and have just began studying it (I am a newbie). I have passed all the steps described in tutorial and installed Delite succesfully. Also I have tried running simple profiling DSL example which goes together with Delite sources. That try was succesfull as I got sensible result.
 
As the next step I tried to modify existing DSL. I have developed my new "empty" DSL containing neither new data structures nor new IR nodes, having existing ProfileDSL as an example. I was going to  write simple applications on clear Scala using this DSL in order to look first how does Delite represent operations with collections, e.g. map. The code I was trying to execute was very simple:
 
val a = Array[Double](2.0, 10.0)
println(a(1))
val b = a map (x => x*3)
println(b(0))
Delite has compiled this code and produced number of Scala kernels and correspondent .deg file. But further executing code failed on one of the kernels.
 
=================================================================================================
TEST: MyTestRunner$@7762965
=================================================================================================
STAGING...
Delite Application Being Staged:[MyTestRunner$]
******Generating the program******
EXECUTING(scala:1)...
/home/afilippov/Delite/delite/generatedCache/scala/src/kernels/x8.scala:6: error: not found: value x7
val out = x7
          ^
one error found
/home/afilippov/Delite/delite/generatedCache/scala/src/kernels/x8.scala:6: error: not found: value x7
val out = x7
 
Correspondent x8.scala code is:
 
package generated.scala
object kernel_x8 {
def apply(x1:Array[Double]): Array[Double] = {
// workaround for refinedManifest problem
val x8 = {
val out = x7
val in = x1
var i = 0
while (i < in.length) {
val x4 = in(i)
val x5 = x4 * 3.0
out(i) = x5
i += 1
}
out
}
x8
}}
 
As we see here, x7 value is really declared nowhere.
 
This case could be easily reproduced on existing ProfileTest example. I just tried to run it with the same code (simple mapping and printing, could be found above) preliminarily added to the very begining of main function. And got the same result: executing failed with the same diagnostics.
 
 
Probably, I am doing something wrong but do not know what exactly. Could you please point me on my mistakes? Or, may be, this is a bug in framework I have accidentally discovered. 
 
Thank you in advance,
Alexander Filippov

 

Kevin Brown

unread,
Nov 8, 2013, 10:28:45 PM11/8/13
to opt...@googlegroups.com
Hi,
Glad to hear you're interested in using Delite.  It looks like you actually hit a bug (the map operation on Array is not implemented correctly).  There's actually a different type called DeliteArray that we always use in DSLs instead of Array; Array mostly just exists for historical reasons and it's functionality is not well tested. DeliteArray uses Delite parallel ops for operations and performs other data layout optimizations.  

In general if you're interested in writing your own DSL I highly recommend you try Forge (https://github.com/stanford-ppl/Forge), which is a DSL for defining DSLs that will auto-generate a Delite DSL for you.  There's an example DSL called 'SimpleVector' in there that you may find useful for getting a feel for the language.  

--Kevin


--
You received this message because you are subscribed to the Google Groups "OptiML" group.
To unsubscribe from this group and stop receiving emails from it, send an email to optiml+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Alexander Filippov

unread,
Nov 14, 2013, 5:50:54 AM11/14/13
to opt...@googlegroups.com
Thanks a lot! I have finally succeeded with DeliteArray. Looking forward for further effective usage of Delite :)
 
Alexander Filippov.

суббота, 9 ноября 2013 г., 7:28:45 UTC+4 пользователь Kevin Brown написал:
Hi,
Glad to hear you're interested in using Delite.  It looks like you actually hit a bug (the map operation on Array is not implemented correctly).  There's actually a different type called DeliteArray that we always use in DSLs instead of Array; Array mostly just exists for historical reasons and it's functionality is not well tested. DeliteArray uses Delite parallel ops for operations and performs other data layout optimizations.  

In general if you're interested in writing your own DSL I highly recommend you try Forge (https://github.com/stanford-ppl/Forge), which is a DSL for defining DSLs that will auto-generate a Delite DSL for you.  There's an example DSL called 'SimpleVector' in there that you may find useful for getting a feel for the language.  

--Kevin
On Thu, Nov 7, 2013 at 11:44 PM, Alexander Filippov <filipp...@gmail.com> wrote:
Hi,
 
I am interested in using Delite and have just began studying it (I am a newbie). I have passed all the steps described in tutorial and installed Delite succesfully. Also I have tried running simple profiling DSL example which goes together with Delite sources. That try was succesfull as I got sensible result.
 
As the next step I tried to modify existing DSL. I have developed my new "empty" DSL containing neither new data structures nor new IR nodes, having existing ProfileDSL as an example. I was going to  write simple applications on clear Scala using this DSL in order to look first how does Delite represent operations with collections, e.g. map. The code I was trying to execute was very simple:
 
val a = Array[Double](2.0, 10.0)
println(a(1))
val b = a map (x => x*3)
println(b(0))
Delite has compiled this code and produced number of Scala kernels and correspondent .deg file. But further executing code failed on one of the kernels.
 
=================================================================================================
TEST: MyTest...@7762965
Reply all
Reply to author
Forward
0 new messages