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"?> <?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"> <ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32"> <ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration> <Configuration>Debug</Configuration>
...@@ -18,12 +18,12 @@ ...@@ -18,12 +18,12 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType> <ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries> <UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset> <PlatformToolset>v110</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType> <ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries> <UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset> <PlatformToolset>v110</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings"> <ImportGroup Label="ExtensionSettings">
...@@ -78,10 +78,10 @@ ...@@ -78,10 +78,10 @@
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="src\cpp\aparapi.cpp" />
<ClCompile Include="src\cpp\clHelper.cpp" /> <ClCompile Include="src\cpp\clHelper.cpp" />
<ClCompile Include="src\cpp\jniHelper.cpp" /> <ClCompile Include="src\cpp\jniHelper.cpp" />
<ClCompile Include="src\cpp\runKernel\Aparapi.cpp" /> <ClCompile Include="src\cpp\opencljni.cpp" />
<ClCompile Include="src\cpp\runKernel\JNIContext.cpp" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="include\com_amd_aparapi_KernelRunner.h" /> <ClInclude Include="include\com_amd_aparapi_KernelRunner.h" />
......
...@@ -15,16 +15,16 @@ ...@@ -15,16 +15,16 @@
</Filter> </Filter>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="src\cpp\jniHelper.cpp"> <ClCompile Include="src\cpp\aparapi.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="src\cpp\clHelper.cpp"> <ClCompile Include="src\cpp\jniHelper.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="src\cpp\runKernel\Aparapi.cpp"> <ClCompile Include="src\cpp\clHelper.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="src\cpp\runKernel\JNIContext.cpp"> <ClCompile Include="src\cpp\opencljni.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
</ItemGroup> </ItemGroup>
......
This diff is collapsed.
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
static const int PASS_ID_PREPARING_EXECUTION = -2; static const int PASS_ID_PREPARING_EXECUTION = -2;
static const int PASS_ID_COMPLETED_EXECUTION = -1; 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; static const int CANCEL_STATUS_TRUE = 1;
//compiler dependant code //compiler dependant code
...@@ -141,10 +141,10 @@ jint writeProfileInfo(JNIContext* jniContext){ ...@@ -141,10 +141,10 @@ jint writeProfileInfo(JNIContext* jniContext){
fprintf(jniContext->profileFile, "%d write %s,", pos++, arg->name); fprintf(jniContext->profileFile, "%d write %s,", pos++, arg->name);
fprintf(jniContext->profileFile, "%lu,%lu,%lu,%lu,", fprintf(jniContext->profileFile, "%lu,%lu,%lu,%lu,",
(unsigned long)(arg->arrayBuffer->write.queued - currSampleBaseTime)/1000, (unsigned long)(arg->arrayBuffer->write.queued - currSampleBaseTime)/1000,
(unsigned long)(arg->arrayBuffer->write.submit - currSampleBaseTime)/1000, (unsigned long)(arg->arrayBuffer->write.submit - currSampleBaseTime)/1000,
(unsigned long)(arg->arrayBuffer->write.start - currSampleBaseTime)/1000, (unsigned long)(arg->arrayBuffer->write.start - currSampleBaseTime)/1000,
(unsigned long)(arg->arrayBuffer->write.end - currSampleBaseTime)/1000); (unsigned long)(arg->arrayBuffer->write.end - currSampleBaseTime)/1000);
} }
} }
...@@ -181,10 +181,10 @@ jint writeProfileInfo(JNIContext* jniContext){ ...@@ -181,10 +181,10 @@ jint writeProfileInfo(JNIContext* jniContext){
fprintf(jniContext->profileFile, "%d read %s,", pos++, arg->name); fprintf(jniContext->profileFile, "%d read %s,", pos++, arg->name);
fprintf(jniContext->profileFile, "%lu,%lu,%lu,%lu,", fprintf(jniContext->profileFile, "%lu,%lu,%lu,%lu,",
(unsigned long)(arg->arrayBuffer->read.queued - currSampleBaseTime)/1000, (unsigned long)(arg->arrayBuffer->read.queued - currSampleBaseTime)/1000,
(unsigned long)(arg->arrayBuffer->read.submit - currSampleBaseTime)/1000, (unsigned long)(arg->arrayBuffer->read.submit - currSampleBaseTime)/1000,
(unsigned long)(arg->arrayBuffer->read.start - currSampleBaseTime)/1000, (unsigned long)(arg->arrayBuffer->read.start - currSampleBaseTime)/1000,
(unsigned long)(arg->arrayBuffer->read.end - currSampleBaseTime)/1000); (unsigned long)(arg->arrayBuffer->read.end - currSampleBaseTime)/1000);
} }
} }
} }
...@@ -789,15 +789,15 @@ void enqueueKernel(JNIContext* jniContext, Range& range, int passes, int argPos, ...@@ -789,15 +789,15 @@ void enqueueKernel(JNIContext* jniContext, Range& range, int passes, int argPos,
cl_int status = CL_SUCCESS; cl_int status = CL_SUCCESS;
for (int passid=0; passid < passes; passid++) { for (int passid=0; passid < passes; passid++) {
int cancelCode = kernelInBytesAsInts[0]; int cancelCode = kernelInBytesAsInts[0];
kernelOutBytesAsInts[0] = passid; kernelOutBytesAsInts[0] = passid;
if (cancelCode == CANCEL_STATUS_TRUE) { if (cancelCode == CANCEL_STATUS_TRUE) {
fprintf(stderr, "received cancellation, aborting at pass %d\n", passid); fprintf(stderr, "received cancellation, aborting at pass %d\n", passid);
kernelOutBytes[0] = -1; kernelOutBytes[0] = -1;
break; break;
} }
//size_t offset = 1; // (size_t)((range.globalDims[0]/jniContext->deviceIdc)*dev); //size_t offset = 1; // (size_t)((range.globalDims[0]/jniContext->deviceIdc)*dev);
status = clSetKernelArg(jniContext->kernel, argPos, sizeof(passid), &(passid)); status = clSetKernelArg(jniContext->kernel, argPos, sizeof(passid), &(passid));
...@@ -1079,16 +1079,16 @@ JNI_JAVA(jint, KernelRunnerJNI, runKernelJNI) ...@@ -1079,16 +1079,16 @@ JNI_JAVA(jint, KernelRunnerJNI, runKernelJNI)
cl_int status = CL_SUCCESS; cl_int status = CL_SUCCESS;
JNIContext* jniContext = JNIContext::getJNIContext(jniContextHandle); JNIContext* jniContext = JNIContext::getJNIContext(jniContextHandle);
jniContext->runKernelInBytes = (jbyte*)jenv->GetDirectBufferAddress(inBuffer); jniContext->runKernelInBytes = (jbyte*)jenv->GetDirectBufferAddress(inBuffer);
jniContext->runKernelOutBytes = (jbyte*)jenv->GetDirectBufferAddress(outBuffer); jniContext->runKernelOutBytes = (jbyte*)jenv->GetDirectBufferAddress(outBuffer);
jbyte* kernelInBytes = jniContext->runKernelInBytes; jbyte* kernelInBytes = jniContext->runKernelInBytes;
int* kernelInBytesAsInts = reinterpret_cast<int*>(kernelInBytes); int* kernelInBytesAsInts = reinterpret_cast<int*>(kernelInBytes);
kernelInBytesAsInts[0] = CANCEL_STATUS_FALSE; kernelInBytesAsInts[0] = CANCEL_STATUS_FALSE;
jbyte* kernelOutBytes = jniContext->runKernelOutBytes; jbyte* kernelOutBytes = jniContext->runKernelOutBytes;
int* kernelOutBytesAsInts = reinterpret_cast<int*>(kernelOutBytes); int* kernelOutBytesAsInts = reinterpret_cast<int*>(kernelOutBytes);
kernelOutBytesAsInts[0] = PASS_ID_PREPARING_EXECUTION; kernelOutBytesAsInts[0] = PASS_ID_PREPARING_EXECUTION;
if (jniContext->firstRun && config->isProfilingEnabled()){ if (jniContext->firstRun && config->isProfilingEnabled()){
try { 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