Skip to content

Commit

Permalink
Remove trailing white-spaces
Browse files Browse the repository at this point in the history
Update README. Android app available
  • Loading branch information
krrishnarraj committed Jul 24, 2014
1 parent a171071 commit 4bf86f2
Show file tree
Hide file tree
Showing 7 changed files with 167 additions and 159 deletions.
2 changes: 2 additions & 0 deletions README.md
Expand Up @@ -51,5 +51,7 @@ eg:
Kernel launch latency : 38.14 us


Android version is published at https://play.google.com/store/apps/details?id=kr.clpeak


Send in results of your device to krrishnarraj@gmail.com
12 changes: 9 additions & 3 deletions STATUS
Expand Up @@ -3,14 +3,20 @@ Known issues:
1. When --use-event-timer option is used on some AMD GPUs, platform returns zero time on event.
As a result, inf is displayed sometimes

2. Not yet tested on mac. There might be some minor compilation issues
2. Disabled integer compute tests on intel platform. It takes forever to compile integer-compute kernel

3. Disabled integer compute tests on apple platform. Causes "Segmentation Fault: 11"

4. Disabled integer & DP compute tests on pocl. Seg-faults for some reason

5. In qualcomm platform, limit max-workgroup size to 128. Kernel launch fails for workgroup size 256(CL_DEVICE_MAX_WORK_ITEM_SIZES)

-------------------------------------------------------------------------------------------------

TODO:

1. Integer compute tests are implemented. Currently there is some problem in compiling kernels
on intel platform. So this test has been disabled
1. Implement flops/watt metric calculation, atleast for linux mobile devices

2. Need to implement local memory bandwidth test


6 changes: 3 additions & 3 deletions android/AndroidManifest.xml
Expand Up @@ -14,7 +14,7 @@
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"
Expand All @@ -24,9 +24,9 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

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

</application>

</manifest>
2 changes: 1 addition & 1 deletion android/res/layout/menu.xml
Expand Up @@ -2,5 +2,5 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/menu_about"
android:title="about" />

</menu>
8 changes: 4 additions & 4 deletions android/src/kr/clpeak/AboutActivity.java
Expand Up @@ -3,12 +3,12 @@
import android.app.Activity;
import android.os.Bundle;


public class AboutActivity extends Activity {

public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

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

Expand Down
188 changes: 94 additions & 94 deletions android/src/kr/clpeak/MainActivity.java
Expand Up @@ -22,129 +22,129 @@
import android.content.Intent;

import kr.clpeak.jni_connect;

public class MainActivity extends Activity {

public native void setenv(String key, String value);

static {
public native void setenv(String key, String value);

static {
System.loadLibrary("clpeak");
}

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

setContentView(R.layout.result_display);
super.onCreate(savedInstanceState);

setContentView(R.layout.result_display);

populatePlatformSpinner();

populatePlatformSpinner();

findViewById(R.id.run_button).setOnClickListener(new OnClickListener(){
findViewById(R.id.run_button).setOnClickListener(new OnClickListener(){
@Override
public void onClick(View view) {
jni_connect clp = new jni_connect(MainActivity.this);
jni_connect clp = new jni_connect(MainActivity.this);
clp.execute();
}
});
});
}

@Override
public boolean onCreateOptionsMenu(Menu menu)
{
MenuInflater menuInflater = getMenuInflater();
menuInflater.inflate(R.layout.menu, menu);
return true;
}

@Override
public boolean onOptionsItemSelected(MenuItem item)
{

switch (item.getItemId())
{
case R.id.menu_about:
Intent intent = new Intent(MainActivity.this, AboutActivity.class);
case R.id.menu_about:
Intent intent = new Intent(MainActivity.this, AboutActivity.class);
startActivity(intent);
}

return true;
}

public void populatePlatformSpinner() {
final Spinner spinnerPlatform = (Spinner) findViewById(R.id.spinner_platform_list);
final List<String> libopenclSoPaths = new ArrayList<String>(Arrays.asList(
"libOpenCL.so",
"/system/lib/libOpenCL.so",
"/system/vendor/lib/libOpenCL.so",
"/system/vendor/lib/egl/libGLES_mali.so",
"/system/vendor/lib/libPVROCL.so",
"/data/data/org.pocl.libs/files/lib/libpocl.so"
));
final List<String> libopenclPlatforms = new ArrayList<String>(Arrays.asList(
"default",
"system lib",
"system vendor lib",
"mali",
"powerVR",
"pocl"
));
// Don't search for "default" & "pocl"
for(int i=(libopenclSoPaths.size()-2); i > 0; i--)
{
if(!(new File(libopenclSoPaths.get(i)).exists()))
{
libopenclSoPaths.remove(i);
libopenclPlatforms.remove(i);
}
}
ArrayAdapter<String> dataAdapter = new ArrayAdapter<String>(this,
android.R.layout.simple_spinner_item, libopenclPlatforms);
dataAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spinnerPlatform.setAdapter(dataAdapter);
spinnerPlatform.setOnItemSelectedListener(new OnItemSelectedListener()
{
@Override
public void onItemSelected(AdapterView<?> arg0, View arg1, int arg2, long arg3)
{
if(libopenclPlatforms.get(arg2).equals("pocl"))
{
if(!(new File(libopenclSoPaths.get(arg2)).exists()))
{
AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);
builder.setMessage("pocl installation not found\ninstall it from playstore?");
builder.setPositiveButton("go", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
Uri uri = Uri.parse("market://details?id=org.pocl.libs");
Intent myAppLinkToMarket = new Intent(Intent.ACTION_VIEW, uri);
startActivity(myAppLinkToMarket);
}
});
builder.setNegativeButton("leave it", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id)
{}
});
builder.show();
spinnerPlatform.setSelection(0);
return;
}
}
setenv("LIBOPENCL_SO_PATH", libopenclSoPaths.get(arg2));
}

@Override
public void onNothingSelected(AdapterView<?> arg0)
{}
}
);

final Spinner spinnerPlatform = (Spinner) findViewById(R.id.spinner_platform_list);

final List<String> libopenclSoPaths = new ArrayList<String>(Arrays.asList(
"libOpenCL.so",
"/system/lib/libOpenCL.so",
"/system/vendor/lib/libOpenCL.so",
"/system/vendor/lib/egl/libGLES_mali.so",
"/system/vendor/lib/libPVROCL.so",
"/data/data/org.pocl.libs/files/lib/libpocl.so"
));

final List<String> libopenclPlatforms = new ArrayList<String>(Arrays.asList(
"default",
"system lib",
"system vendor lib",
"mali",
"powerVR",
"pocl"
));

// Don't search for "default" & "pocl"
for(int i=(libopenclSoPaths.size()-2); i > 0; i--)
{
if(!(new File(libopenclSoPaths.get(i)).exists()))
{
libopenclSoPaths.remove(i);
libopenclPlatforms.remove(i);
}
}

ArrayAdapter<String> dataAdapter = new ArrayAdapter<String>(this,
android.R.layout.simple_spinner_item, libopenclPlatforms);
dataAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spinnerPlatform.setAdapter(dataAdapter);

spinnerPlatform.setOnItemSelectedListener(new OnItemSelectedListener()
{
@Override
public void onItemSelected(AdapterView<?> arg0, View arg1, int arg2, long arg3)
{
if(libopenclPlatforms.get(arg2).equals("pocl"))
{
if(!(new File(libopenclSoPaths.get(arg2)).exists()))
{
AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);

builder.setMessage("pocl installation not found\ninstall it from playstore?");

builder.setPositiveButton("go", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
Uri uri = Uri.parse("market://details?id=org.pocl.libs");
Intent myAppLinkToMarket = new Intent(Intent.ACTION_VIEW, uri);
startActivity(myAppLinkToMarket);
}
});

builder.setNegativeButton("leave it", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id)
{}
});

builder.show();
spinnerPlatform.setSelection(0);
return;
}
}
setenv("LIBOPENCL_SO_PATH", libopenclSoPaths.get(arg2));
}

@Override
public void onNothingSelected(AdapterView<?> arg0)
{}
}
);
}
}

0 comments on commit 4bf86f2

Please sign in to comment.