Skip to content

Commit

Permalink
Android GUI app initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
krrishnarraj committed Jul 17, 2014
1 parent b3ddfdb commit 512e1f6
Show file tree
Hide file tree
Showing 23 changed files with 594 additions and 0 deletions.
86 changes: 86 additions & 0 deletions android/.cproject
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
<storageModule moduleId="org.eclipse.cdt.core.settings">
<cconfiguration id="cdt.managedbuild.config.gnu.exe.debug.2129675535">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.exe.debug.2129675535" moduleId="org.eclipse.cdt.core.settings" name="Debug">
<externalSettings/>
<extensions>
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.VCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.MakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.exe.debug.2129675535" name="Debug" parent="cdt.managedbuild.config.gnu.exe.debug">
<folderInfo id="cdt.managedbuild.config.gnu.exe.debug.2129675535." name="/" resourcePath="">
<toolChain id="com.android.toolchain.gcc.1766701572" name="Android GCC" superClass="com.android.toolchain.gcc">
<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.android.targetPlatform.1782611361" isAbstract="false" superClass="com.android.targetPlatform"/>
<builder id="com.android.builder.1408819518" managedBuildOn="false" name="Android Builder.Debug" superClass="com.android.builder"/>
<tool id="com.android.gcc.compiler.2041049315" name="Android GCC Compiler" superClass="com.android.gcc.compiler"/>
</toolChain>
</folderInfo>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
<cconfiguration id="cdt.managedbuild.config.gnu.exe.release.1059008839">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.exe.release.1059008839" moduleId="org.eclipse.cdt.core.settings" name="Release">
<externalSettings/>
<extensions>
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.VCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.MakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.exe.release.1059008839" name="Release" parent="cdt.managedbuild.config.gnu.exe.release">
<folderInfo id="cdt.managedbuild.config.gnu.exe.release.1059008839." name="/" resourcePath="">
<toolChain id="com.android.toolchain.gcc.1523468043" name="Android GCC" superClass="com.android.toolchain.gcc">
<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.android.targetPlatform.1896392034" isAbstract="false" superClass="com.android.targetPlatform"/>
<builder id="com.android.builder.1557013259" managedBuildOn="false" name="Android Builder.Release" superClass="com.android.builder"/>
<tool id="com.android.gcc.compiler.471512508" name="Android GCC Compiler" superClass="com.android.gcc.compiler"/>
</toolChain>
</folderInfo>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<project id="clpeak.cdt.managedbuild.target.gnu.exe.1420407076" name="Executable" projectType="cdt.managedbuild.target.gnu.exe"/>
</storageModule>
<storageModule moduleId="scannerConfiguration">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.debug.2129675535;cdt.managedbuild.config.gnu.exe.debug.2129675535.;cdt.managedbuild.tool.gnu.c.compiler.exe.debug.689243433;cdt.managedbuild.tool.gnu.c.compiler.input.161966383">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.release.1059008839;cdt.managedbuild.config.gnu.exe.release.1059008839.;cdt.managedbuild.tool.gnu.cpp.compiler.exe.release.1257805505;cdt.managedbuild.tool.gnu.cpp.compiler.input.1858905957">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.debug.2129675535;cdt.managedbuild.config.gnu.exe.debug.2129675535.;cdt.managedbuild.tool.gnu.cpp.compiler.exe.debug.1851795344;cdt.managedbuild.tool.gnu.cpp.compiler.input.502122968">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.release.1059008839;cdt.managedbuild.config.gnu.exe.release.1059008839.;cdt.managedbuild.tool.gnu.c.compiler.exe.release.1113124318;cdt.managedbuild.tool.gnu.c.compiler.input.1350306377">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
<storageModule moduleId="refreshScope" versionNumber="2">
<configuration configurationName="Release">
<resource resourceType="PROJECT" workspacePath="/clpeak"/>
</configuration>
<configuration configurationName="Debug">
<resource resourceType="PROJECT" workspacePath="/clpeak"/>
</configuration>
</storageModule>
</cproject>
49 changes: 49 additions & 0 deletions android/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>clpeak</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
<triggers>clean,full,incremental,</triggers>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.ApkBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
<triggers>full,incremental,</triggers>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.cdt.core.cnature</nature>
<nature>org.eclipse.cdt.core.ccnature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
</natures>
</projectDescription>
31 changes: 31 additions & 0 deletions android/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="kr.clpeak"
android:versionCode="1"
android:versionName="1.0 beta" android:installLocation="auto">
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="19" />

<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >

<activity
android:name="kr.clpeak.MainActivity"
android:label="@string/app_name"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<activity android:name=".AboutActivity"></activity>

</application>

</manifest>
29 changes: 29 additions & 0 deletions android/jni/Android.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_LDLIBS := -ldl -llog
LOCAL_MODULE := clpeak
LOCAL_CFLAGS += -DANDROID_LOGGER -DUSE_STUB_OPENCL
LOCAL_CXXFLAGS += -fexceptions -std=c++11

SRC_FOLDER := ../../src

LOCAL_C_INCLUDES += \
$(LOCAL_PATH)/libopencl-stub/include/ \
$(LOCAL_PATH)/$(SRC_FOLDER)/include/ \
$(LOCAL_PATH)/$(SRC_FOLDER)/kernels/

LOCAL_SRC_FILES := \
$(SRC_FOLDER)/common.cpp \
$(SRC_FOLDER)/clpeak.cpp \
$(SRC_FOLDER)/global_bandwidth.cpp \
$(SRC_FOLDER)/compute_sp.cpp \
$(SRC_FOLDER)/compute_dp.cpp \
$(SRC_FOLDER)/compute_integer.cpp \
$(SRC_FOLDER)/transfer_bandwidth.cpp \
$(SRC_FOLDER)/kernel_latency.cpp \
$(SRC_FOLDER)/entry_android.cpp \
$(SRC_FOLDER)/options.cpp \
$(SRC_FOLDER)/logger_android.cpp \
libopencl-stub/libopencl.c

include $(BUILD_SHARED_LIBRARY)
2 changes: 2 additions & 0 deletions android/jni/Application.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
APP_STL := gnustl_static
APP_ABI := armeabi-v7a x86
1 change: 1 addition & 0 deletions android/jni/CLONE_LIBOPENCL_STUB_HERE
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
clone libopencl-stub from https://github.com/krrishnarraj/libopencl-stub
14 changes: 14 additions & 0 deletions android/project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system edit
# "ant.properties", and override values to adapt the script to your
# project structure.
#
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt

# Project target.
target=android-19
Binary file added android/res/drawable-hdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added android/res/drawable-mdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added android/res/drawable-xhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added android/res/drawable-xxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions android/res/layout/about_form.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/RelativeLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#F0F0F0" >

<TextView
android:id="@+id/textView_about"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:autoLink="web"
android:gravity="center|top"
android:paddingTop="15dp"
android:text="@string/about_clpeak"
android:textAppearance="?android:attr/textAppearanceMedium" />

</RelativeLayout>
6 changes: 6 additions & 0 deletions android/res/layout/menu.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/menu_about"
android:title="about" />

</menu>
63 changes: 63 additions & 0 deletions android/res/layout/result_display.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/RelativeLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >

<LinearLayout
android:id="@+id/top_linear_layout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:background="@android:color/darker_gray"
android:gravity="center_horizontal|center" >

<CheckedTextView
android:id="@+id/text_opencl_platform"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="platform : " />

<Spinner
android:id="@+id/spinner_platform_list"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_toRightOf="@+id/text_opencl_platform" />
</LinearLayout>

<ScrollView
android:id="@+id/textAreaScroller_1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/bottom_relative_layout"
android:layout_below="@+id/top_linear_layout"
android:scrollbarStyle="insideInset"
android:scrollbars="vertical" >

<TextView
android:id="@+id/clpeak_result_textview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textIsSelectable="true" />
</ScrollView>

<RelativeLayout
android:id="@+id/bottom_relative_layout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="@android:color/darker_gray"
android:gravity="center"
android:paddingLeft="50dp"
android:paddingRight="50dp" >

<Button
android:id="@+id/run_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:text="Run" />

</RelativeLayout>

</RelativeLayout>
11 changes: 11 additions & 0 deletions android/res/values-v11/styles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<resources>

<!--
Base application theme for API 11+. This theme completely replaces
AppBaseTheme from res/values/styles.xml on API 11+ devices.
-->
<style name="AppBaseTheme" parent="android:Theme.Holo.Light">
<!-- API 11 theme customizations can go here. -->
</style>

</resources>
12 changes: 12 additions & 0 deletions android/res/values-v14/styles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<resources>

<!--
Base application theme for API 14+. This theme completely replaces
AppBaseTheme from BOTH res/values/styles.xml and
res/values-v11/styles.xml on API 14+ devices.
-->
<style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar">
<!-- API 14 theme customizations can go here. -->
</style>

</resources>
7 changes: 7 additions & 0 deletions android/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<resources>

<string name="app_name">clpeak</string>

<string name="about_clpeak">\nclpeak is a benchmarking tool intended toward developers to fine-tune opencl kernels for a particular device/class of device. It calculates bandwidth and compute performance for different vector-widths of a datatype\n\ngithub.com/krrishnarraj/clpeak</string>

</resources>
20 changes: 20 additions & 0 deletions android/res/values/styles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<resources>

<!--
Base application theme, dependent on API level. This theme is replaced
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
-->
<style name="AppBaseTheme" parent="android:Theme.Light">
<!--
Theme customizations available in newer API levels can go in
res/values-vXX/styles.xml, while customizations related to
backward-compatibility can go here.
-->
</style>

<!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
<!-- All customizations that are NOT specific to a particular API-level can go here. -->
</style>

</resources>
15 changes: 15 additions & 0 deletions android/src/kr/clpeak/AboutActivity.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package kr.clpeak;

import android.app.Activity;
import android.os.Bundle;


public class AboutActivity extends Activity {

public void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);
setContentView(R.layout.about_form);
}

}
Loading

0 comments on commit 512e1f6

Please sign in to comment.