Skip to content

Commit 09a5534

Browse files
committed
1 parent 6d199ca commit 09a5534

File tree

90 files changed

+11417
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+11417
-0
lines changed

Old/.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
target
2+
project/boot
3+
project/target
4+
*~

Old/Collections/ABOUT

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
2+
ScalaCL makes Scala faster and GPGPU trivial.
3+
It features :
4+
- a compiler plugin that optimizes regular Scala code without adding any dependency
5+
- a library of OpenCL-backed collections that execute Scala code (map, filter...) on GPUs transparently, thanks to the compiler plugin
6+
7+
Website:
8+
http://scalacl.googlecode.com/
9+
10+
Author:
11+
Olivier Chafik <[email protected]>
12+
http://ochafik.free.fr/blog/
13+
http://twitter.com/ochafik
14+
15+
Current features :
16+
- CLArray[T], CLRange (create with CLArray(1, 2, 3...), new CLArray[Int](n), Seq.cl or Seq.toCLArray) with accelerated .map, .filter, .zip and .zipWithIndex operations (when the inline closures are convertible by the compiler plugin)
17+
-> For more details, see http://code.google.com/p/scalacl/wiki/CLConvertibleLanguageSubset
18+
- Transformation of regular Scala operations on Array[T] and inline ranges : .map, .foreach, .reduce/fold/scan|Left/Right, .sum...
19+
-> For more details, see http://code.google.com/p/scalacl/wiki/ScalaCLPlugin
20+
21+
Planned features :
22+
- better translation of Scala functions to OpenCL kernels to support more Scala constructs
23+
- rewrite of operation streams into loops when functions are side-effect-free (a.map(f1).map(f2).filter(f3).takeWhile(f4)...)
24+
- auto-vectorization of OpenCL code
25+
26+
Please use NativeLibs4Java's user group and bug-tracker for feedback or help about ScalaCL and its compiler plugin :
27+
http://groups.google.fr/group/nativelibs4java/
28+
http://code.google.com/p/nativelibs4java/issues/list

Old/Collections/build.sbt

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name := "scalacl"
2+
3+
version := "0.3-SNAPSHOT"
4+
5+
organization := "com.nativelibs4java"
6+
7+
//scalaHome := Some(file("/Users/ochafik/bin/scala-2.10.0.r25286-b20110715023800"))
8+
9+
scalaVersion := "2.9.1"
10+
11+
resolvers += "NativeLibs4Java Repository" at "http://nativelibs4java.sourceforge.net/maven/"
12+
13+
libraryDependencies ++= Seq(
14+
"com.nativelibs4java" % "javacl" % "1.0-SNAPSHOT",
15+
"com.novocode" % "junit-interface" % "0.5" % "test->default"
16+
)
17+

Old/Collections/copyToScala

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
VERSION="`cat pom.xml | grep '<version' | head -n 1 | sed -e 's/.*<version>\(.*\)<\/version>.*/\1/g'`"
2+
#VERSION="0.2.Beta1"
3+
4+
LIB_JAR_OUT="$SCALA_HOME/lib"
5+
PLUGIN_JAR_OUT="$SCALA_HOME/misc/scala-devel/plugins"
6+
7+
LIB_JAR_IN="target"
8+
PLUGIN_JAR_IN="../ScalaCLPlugin/target"
9+
10+
LIB_JAR="scalacl-$VERSION-shaded.jar"
11+
PLUGIN_JAR="scalacl-compiler-plugin-$VERSION.jar"
12+
13+
rm $LIB_JAR_OUT/scalacl*.jar
14+
rm $PLUGIN_JAR_OUT/scalacl*.jar
15+
16+
if [[ "$NO_COPY" != "1" ]] ; then
17+
cp $LIB_JAR_IN/$LIB_JAR $LIB_JAR_OUT
18+
cp $PLUGIN_JAR_IN/$PLUGIN_JAR $PLUGIN_JAR_OUT ;
19+
fi

Old/Collections/nbactions.xml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<actions>
3+
<action>
4+
<actionName>run</actionName>
5+
<goals>
6+
<goal>process-classes</goal>
7+
<goal>org.codehaus.mojo:exec-maven-plugin:1.1.1:exec</goal>
8+
</goals>
9+
<properties>
10+
<exec.classpathScope>runtime</exec.classpathScope>
11+
<exec.args>-classpath %classpath scalacl.Test</exec.args>
12+
<exec.executable>java</exec.executable>
13+
</properties>
14+
</action>
15+
<action>
16+
<actionName>debug</actionName>
17+
<goals>
18+
<goal>process-classes</goal>
19+
<goal>org.codehaus.mojo:exec-maven-plugin:1.1.1:exec</goal>
20+
</goals>
21+
<properties>
22+
<exec.classpathScope>runtime</exec.classpathScope>
23+
<exec.args>-Xdebug -Xrunjdwp:transport=dt_socket,server=n,address=${jpda.address} -classpath %classpath scalacl.Test</exec.args>
24+
<jpda.listen>true</jpda.listen>
25+
<exec.executable>java</exec.executable>
26+
</properties>
27+
</action>
28+
<action>
29+
<actionName>profile</actionName>
30+
<goals>
31+
<goal>process-classes</goal>
32+
<goal>org.codehaus.mojo:exec-maven-plugin:1.1.1:exec</goal>
33+
</goals>
34+
<properties>
35+
<exec.args>${profiler.args} -classpath %classpath scalacl.Test</exec.args>
36+
<profiler.action>profile</profiler.action>
37+
<exec.executable>${profiler.java}</exec.executable>
38+
</properties>
39+
</action>
40+
</actions>

Old/Collections/pom.xml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
<groupId>com.nativelibs4java</groupId>
5+
<artifactId>scalacl-legacy</artifactId>
6+
<name>ScalaCL Collections</name>
7+
<url>http://code.google.com/p/scalacl/</url>
8+
<packaging>jar</packaging>
9+
10+
<description>
11+
ScalaCL Collections are GPGPU-stored collections which execute some of their operations (filter, map...) straight on the GPU.
12+
</description>
13+
14+
<parent>
15+
<groupId>com.nativelibs4java</groupId>
16+
<artifactId>scalacl-legacy-parent</artifactId>
17+
<version>0.3.1-SNAPSHOT</version>
18+
<relativePath>..</relativePath>
19+
</parent>
20+
21+
<dependencies>
22+
<dependency>
23+
<groupId>com.nativelibs4java</groupId>
24+
<artifactId>javacl</artifactId>
25+
</dependency>
26+
</dependencies>
27+
28+
<build>
29+
<plugins>
30+
<plugin>
31+
<groupId>org.apache.maven.plugins</groupId>
32+
<artifactId>maven-shade-plugin</artifactId>
33+
</plugin>
34+
</plugins>
35+
</build>
36+
37+
</project>
38+
39+
40+
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
sbt.version=0.11.0

Old/Collections/sbazPackage

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
#!/bin/bash
2+
MVN_VERSION="`cat pom.xml | grep '<version' | head -n 1 | sed -e 's/.*<version>\(.*\)<\/version>.*/\1/g'`"
3+
SBAZ_VERSION_AUTO="`echo $MVN_VERSION | sed -e "s/-SNAPSHOT/-SNAPSHOT-\`date '+%Y%m%d'\`/g"`"
4+
SBAZ_VERSION=${SBAZ_VERSION:-$SBAZ_VERSION_AUTO}
5+
LINK_BASE="http://nativelibs4java.sourceforge.net/sbaz/scalacl/"
6+
#LINK_BASE="http://ochafik.com/sbaz/scalacl/"
7+
8+
SCALACL_HOME="`pwd`"
9+
10+
echo "###################################################"
11+
echo "# ScalaCL : "
12+
echo "# Maven version = $MVN_VERSION"
13+
echo "# sbaz version = $SBAZ_VERSION"
14+
echo "###################################################"
15+
16+
echo "# Building ScalaCL Collections"
17+
mvn -Djarsigner.skip=false -Dstorepass=$KEYSTORE_PASS package -DskipTests
18+
19+
cd ../Plugin
20+
echo "# Building ScalaCL Compiler Plugin"
21+
mvn -Djarsigner.skip=false -Dstorepass=$KEYSTORE_PASS package -DskipTests
22+
cd $SCALACL_HOME
23+
24+
25+
TEMP_OUT=target/sbaz_out
26+
LIB_JAR_OUT=$TEMP_OUT/lib
27+
PLUGIN_JAR_OUT=$TEMP_OUT/misc/scala-devel/plugins
28+
29+
rm -fR $TEMP_OUT
30+
31+
mkdir -p $LIB_JAR_OUT
32+
mkdir -p $PLUGIN_JAR_OUT
33+
34+
echo "# Copying libraries"
35+
if [[ "$DONT_USE_SHADED" == "1" ]] ; then
36+
export SBAZ_VERSION="$SBAZ_VERSION-devel"
37+
NL4J_BASE="/Users/ochafik/.m2/repository/com/nativelibs4java"
38+
cp target/scalacl-$MVN_VERSION.jar $LIB_JAR_OUT
39+
cp $NL4J_BASE/bridj/0.5/bridj-5.jar $LIB_JAR_OUT
40+
cp $NL4J_BASE/opencl4java-bridj/1.0.0-RC1/opencl4java-bridj-1.0.0-RC1.jar $LIB_JAR_OUT
41+
cp $NL4J_BASE/javacl-core-bridj/1.0.0-RC1/javacl-core-bridj-1.0.0-RC1.jar $LIB_JAR_OUT
42+
cp $NL4J_BASE/javacl-bridj/1.0.0-RC1/javacl-bridj-1.0.0-RC1.jar $LIB_JAR_OUT
43+
cp $NL4J_BASE/libcl-bridj/1.0.0-RC1/libcl-bridj-1.0.0-RC1.jar $LIB_JAR_OUT ;
44+
else
45+
cp target/scalacl-$MVN_VERSION-shaded.jar $LIB_JAR_OUT ;
46+
fi
47+
48+
echo "# Copied the following libraries :"
49+
ls -l $LIB_JAR_OUT
50+
51+
echo "# Copying compiler plugin libraries"
52+
cp ../Plugin/target/scalacl-compiler-plugin-$MVN_VERSION.jar $PLUGIN_JAR_OUT
53+
54+
echo "# Packing for sbaz"
55+
sbaz pack scalacl $TEMP_OUT \
56+
--linkbase $LINK_BASE \
57+
--version $SBAZ_VERSION \
58+
--outdir src/main/sbaz \
59+
--descfile ABOUT || ( echo "sbaz pack failed" && exit 1 )
60+
61+
mkdir -p src/main/sbaz
62+
63+
sbaz remove scalacl
64+
sbaz compact
65+
#sbaz retract scalacl/$SBAZ_VERSION
66+
if [[ "$DONT_SHARE" == "1" ]] ; then
67+
echo "Not sharing the package (use SHARE=1 to share)"
68+
echo src/main/sbaz/scalacl-$SBAZ_VERSION.sbp ;
69+
else
70+
sbaz share *.advert ;
71+
fi
72+
mv *.advert src/main/sbaz
73+
open src/main/sbaz
74+
75+
echo "Now please copy 'src/main/sbaz/scalacl-$SBAZ_VERSION.sbp' to '$LINK_BASE'"

Old/Collections/scalacl.iml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
3+
<component name="FacetManager">
4+
<facet type="scala" name="Scala">
5+
<configuration>
6+
<option name="compilerLibraryLevel" value="Project" />
7+
<option name="compilerLibraryName" value="Maven: org.scala-lang:scala-compiler-bundle:2.9.0" />
8+
<option name="maximumHeapSize" value="1024" />
9+
<option name="optimiseBytecode" value="true" />
10+
<option name="vmOptions" value="-Xms64m" />
11+
</configuration>
12+
</facet>
13+
</component>
14+
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5" inherit-compiler-output="false">
15+
<output url="file://$MODULE_DIR$/target/classes" />
16+
<output-test url="file://$MODULE_DIR$/target/test-classes" />
17+
<content url="file://$MODULE_DIR$">
18+
<sourceFolder url="file://$MODULE_DIR$/src/main/scala" isTestSource="false" />
19+
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" isTestSource="false" />
20+
<sourceFolder url="file://$MODULE_DIR$/src/test/scala" isTestSource="true" />
21+
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" isTestSource="true" />
22+
<excludeFolder url="file://$MODULE_DIR$/target" />
23+
</content>
24+
<orderEntry type="inheritedJdk" />
25+
<orderEntry type="sourceFolder" forTests="false" />
26+
<orderEntry type="module" module-name="javacl" />
27+
<orderEntry type="module" module-name="javacl-core" />
28+
<orderEntry type="module" module-name="opencl4java" />
29+
<orderEntry type="library" name="Maven: com.nativelibs4java:bridj:c-only:0.6-SNAPSHOT" level="project" />
30+
<orderEntry type="library" name="Maven: com.nativelibs4java.thirdparty.com.google.android:dx:11" level="project" />
31+
<orderEntry type="library" name="Maven: org.scala-lang:scala-library:2.9.0" level="project" />
32+
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.8.2" level="project" />
33+
</component>
34+
</module>
35+

0 commit comments

Comments
 (0)