Skip to content
Snippets Groups Projects
Commit ae0a9ae7 authored by Barney's avatar Barney
Browse files

beta version of Device configuration changes and introduction of KernelManager...

beta version of Device configuration changes and introduction of KernelManager - reverting some accidentally commited files
parent b5389d7f
No related branches found
No related tags found
No related merge requests found
No preview for this file type
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
......@@ -18,12 +18,12 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
......@@ -78,10 +78,10 @@
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="src\cpp\aparapi.cpp" />
<ClCompile Include="src\cpp\clHelper.cpp" />
<ClCompile Include="src\cpp\jniHelper.cpp" />
<ClCompile Include="src\cpp\runKernel\Aparapi.cpp" />
<ClCompile Include="src\cpp\runKernel\JNIContext.cpp" />
<ClCompile Include="src\cpp\opencljni.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="include\com_amd_aparapi_KernelRunner.h" />
......
......@@ -15,16 +15,16 @@
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="src\cpp\jniHelper.cpp">
<ClCompile Include="src\cpp\aparapi.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\cpp\clHelper.cpp">
<ClCompile Include="src\cpp\jniHelper.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\cpp\runKernel\Aparapi.cpp">
<ClCompile Include="src\cpp\clHelper.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\cpp\runKernel\JNIContext.cpp">
<ClCompile Include="src\cpp\opencljni.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
......
This diff is collapsed.
......@@ -52,7 +52,7 @@
static const int PASS_ID_PREPARING_EXECUTION = -2;
static const int PASS_ID_COMPLETED_EXECUTION = -1;
static const int CANCEL_STATUS_FALSE = 0;
static const int CANCEL_STATUS_FALSE = 0;
static const int CANCEL_STATUS_TRUE = 1;
//compiler dependant code
......@@ -141,10 +141,10 @@ jint writeProfileInfo(JNIContext* jniContext){
fprintf(jniContext->profileFile, "%d write %s,", pos++, arg->name);
fprintf(jniContext->profileFile, "%lu,%lu,%lu,%lu,",
(unsigned long)(arg->arrayBuffer->write.queued - currSampleBaseTime)/1000,
(unsigned long)(arg->arrayBuffer->write.submit - currSampleBaseTime)/1000,
(unsigned long)(arg->arrayBuffer->write.start - currSampleBaseTime)/1000,
(unsigned long)(arg->arrayBuffer->write.end - currSampleBaseTime)/1000);
(unsigned long)(arg->arrayBuffer->write.queued - currSampleBaseTime)/1000,
(unsigned long)(arg->arrayBuffer->write.submit - currSampleBaseTime)/1000,
(unsigned long)(arg->arrayBuffer->write.start - currSampleBaseTime)/1000,
(unsigned long)(arg->arrayBuffer->write.end - currSampleBaseTime)/1000);
}
}
......@@ -181,10 +181,10 @@ jint writeProfileInfo(JNIContext* jniContext){
fprintf(jniContext->profileFile, "%d read %s,", pos++, arg->name);
fprintf(jniContext->profileFile, "%lu,%lu,%lu,%lu,",
(unsigned long)(arg->arrayBuffer->read.queued - currSampleBaseTime)/1000,
(unsigned long)(arg->arrayBuffer->read.submit - currSampleBaseTime)/1000,
(unsigned long)(arg->arrayBuffer->read.start - currSampleBaseTime)/1000,
(unsigned long)(arg->arrayBuffer->read.end - currSampleBaseTime)/1000);
(unsigned long)(arg->arrayBuffer->read.queued - currSampleBaseTime)/1000,
(unsigned long)(arg->arrayBuffer->read.submit - currSampleBaseTime)/1000,
(unsigned long)(arg->arrayBuffer->read.start - currSampleBaseTime)/1000,
(unsigned long)(arg->arrayBuffer->read.end - currSampleBaseTime)/1000);
}
}
}
......@@ -789,15 +789,15 @@ void enqueueKernel(JNIContext* jniContext, Range& range, int passes, int argPos,
cl_int status = CL_SUCCESS;
for (int passid=0; passid < passes; passid++) {
int cancelCode = kernelInBytesAsInts[0];
kernelOutBytesAsInts[0] = passid;
int cancelCode = kernelInBytesAsInts[0];
kernelOutBytesAsInts[0] = passid;
if (cancelCode == CANCEL_STATUS_TRUE) {
fprintf(stderr, "received cancellation, aborting at pass %d\n", passid);
kernelOutBytes[0] = -1;
break;
}
if (cancelCode == CANCEL_STATUS_TRUE) {
fprintf(stderr, "received cancellation, aborting at pass %d\n", passid);
kernelOutBytes[0] = -1;
break;
}
//size_t offset = 1; // (size_t)((range.globalDims[0]/jniContext->deviceIdc)*dev);
status = clSetKernelArg(jniContext->kernel, argPos, sizeof(passid), &(passid));
......@@ -1079,16 +1079,16 @@ JNI_JAVA(jint, KernelRunnerJNI, runKernelJNI)
cl_int status = CL_SUCCESS;
JNIContext* jniContext = JNIContext::getJNIContext(jniContextHandle);
jniContext->runKernelInBytes = (jbyte*)jenv->GetDirectBufferAddress(inBuffer);
jniContext->runKernelOutBytes = (jbyte*)jenv->GetDirectBufferAddress(outBuffer);
jniContext->runKernelInBytes = (jbyte*)jenv->GetDirectBufferAddress(inBuffer);
jniContext->runKernelOutBytes = (jbyte*)jenv->GetDirectBufferAddress(outBuffer);
jbyte* kernelInBytes = jniContext->runKernelInBytes;
int* kernelInBytesAsInts = reinterpret_cast<int*>(kernelInBytes);
kernelInBytesAsInts[0] = CANCEL_STATUS_FALSE;
jbyte* kernelInBytes = jniContext->runKernelInBytes;
int* kernelInBytesAsInts = reinterpret_cast<int*>(kernelInBytes);
kernelInBytesAsInts[0] = CANCEL_STATUS_FALSE;
jbyte* kernelOutBytes = jniContext->runKernelOutBytes;
int* kernelOutBytesAsInts = reinterpret_cast<int*>(kernelOutBytes);
kernelOutBytesAsInts[0] = PASS_ID_PREPARING_EXECUTION;
jbyte* kernelOutBytes = jniContext->runKernelOutBytes;
int* kernelOutBytesAsInts = reinterpret_cast<int*>(kernelOutBytes);
kernelOutBytesAsInts[0] = PASS_ID_PREPARING_EXECUTION;
if (jniContext->firstRun && config->isProfilingEnabled()){
try {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment