Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hpvm-release
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
llvm
hpvm-release
Commits
ce1305e0
"git@gitlab.engr.illinois.edu:llvm/hpvm-release.git" did not exist on "57e72ac9c24c1d2cebef0876ea28a2a85cfc777b"
Commit
ce1305e0
authored
10 years ago
by
Prakalp Srivastava
Browse files
Options
Downloads
Patches
Plain Diff
Removed unecessary code from visc-rt.cpp
parent
aca66ed5
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
llvm/projects/visc-rt/visc-rt.cpp
+4
-61
4 additions, 61 deletions
llvm/projects/visc-rt/visc-rt.cpp
with
4 additions
and
61 deletions
llvm/projects/visc-rt/visc-rt.cpp
+
4
−
61
View file @
ce1305e0
...
...
@@ -2,8 +2,9 @@
#include
<cstdlib>
#include
<cstdio>
#include
<string>
#include
<assert.h>
#include
<CL/cl.h>
#include
<cassert>
#include
"llvm/Support/Debug.h"
//#include "visc-rt.h"
typedef
struct
{
...
...
@@ -57,7 +58,7 @@ void* llvm_visc_ptx_initContext() {
for
(
unsigned
i
=
0
;
i
<
numPlatforms
;
i
++
)
{
char
buffer
[
10240
];
printf
(
" --
%d
--
\n
"
,
i
);
printf
(
" --
Device %d Info
--
\n
"
,
i
);
clGetPlatformInfo
(
platforms
[
i
],
CL_PLATFORM_PROFILE
,
10240
,
buffer
,
NULL
);
printf
(
" PROFILE = %s
\n
"
,
buffer
);
clGetPlatformInfo
(
platforms
[
i
],
CL_PLATFORM_VERSION
,
10240
,
buffer
,
NULL
);
...
...
@@ -97,7 +98,7 @@ extern "C"
void
*
llvm_visc_ptx_argument_ptr
(
void
*
graphID
,
void
*
input
,
int
arg_index
,
size_t
size
,
bool
isInput
,
bool
isOutput
)
{
printf
(
"Set Pointer Input. Argument Index = %d, Ptr = %p, Size = %lu
\n
"
,
arg_index
,
input
,
size
);
// Size should be non-zero
assert
(
size
!=
0
);
assert
(
size
!=
0
&&
"Size of data pointed to has to be non-zero!"
);
printf
(
"
\t
Input: %d, Output: %d
\n
"
,
isInput
,
isOutput
);
DFNodeContext_PTX
*
Context
=
(
DFNodeContext_PTX
*
)
graphID
;
cl_int
errcode
;
...
...
@@ -227,48 +228,6 @@ void* llvm_visc_ptx_launch(const char* FileName, const char* KernelName) {
size_t
kernelLength
;
cl_int
errcode
;
/* Application Specific Code
// OpenCL device memory for matrices
cl_mem d_A;
cl_mem d_B;
cl_mem d_C;
*/
/*****************************************/
/* Initialize OpenCL */
/*****************************************/
// query the number of platforms
/*cl_uint numPlatforms;
errcode = clGetPlatformIDs(0, NULL, &numPlatforms);
checkErr(errcode, CL_SUCCESS, "Failure to get number of platforms");
// now get all the platform IDs
cl_platform_id* platforms = (cl_platform_id*) malloc(sizeof(cl_platform_id)*numPlatforms);
errcode = clGetPlatformIDs(numPlatforms, platforms, NULL);
checkErr(errcode, CL_SUCCESS, "Failure to get platform IDs");
for(unsigned i=0; i < numPlatforms; i++) {
char buffer[10240];
printf(" -- %d --\n", i);
clGetPlatformInfo(platforms[i], CL_PLATFORM_PROFILE, 10240, buffer, NULL);
printf(" PROFILE = %s\n", buffer);
clGetPlatformInfo(platforms[i], CL_PLATFORM_VERSION, 10240, buffer, NULL);
printf(" VERSION = %s\n", buffer);
clGetPlatformInfo(platforms[i], CL_PLATFORM_NAME, 10240, buffer, NULL);
printf(" NAME = %s\n", buffer);
clGetPlatformInfo(platforms[i], CL_PLATFORM_VENDOR, 10240, buffer, NULL);
printf(" VENDOR = %s\n", buffer);
clGetPlatformInfo(platforms[i], CL_PLATFORM_EXTENSIONS, 10240, buffer, NULL);
printf(" EXTENSIONS = %s\n", buffer);
}
// set platform property - just pick the first one
cl_context_properties properties[] = {CL_CONTEXT_PLATFORM,
(long) platforms[0],
0};
Context->clGPUContext = clCreateContextFromType(properties, CL_DEVICE_TYPE_GPU,
NULL, NULL, &errcode);
checkErr(errcode, CL_SUCCESS, "Failure to create GPU context");
*/
// For a single context for all kernels
Context
->
clGPUContext
=
globalGPUContext
;
...
...
@@ -318,22 +277,6 @@ void* llvm_visc_ptx_launch(const char* FileName, const char* KernelName) {
Context
->
clKernel
=
clCreateKernel
(
Context
->
clProgram
,
KernelName
,
&
errcode
);
checkErr
(
errcode
,
CL_SUCCESS
,
"Failure to create kernel"
);
// Invoke the callback function to put memory allocations in place
//rootFunc(Context);
/* App specific code
// Deallocate memory
free(h_A);
free(h_B);
free(h_C);
clReleaseMemObject(d_A);
clReleaseMemObject(d_C);
clReleaseMemObject(d_B);
*/
free
(
clDevices
);
free
(
programSource
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment