Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libclfft
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
einsteinathome
libclfft
Commits
31cb1fc5
Commit
31cb1fc5
authored
14 years ago
by
Oliver Bock
Browse files
Options
Downloads
Patches
Plain Diff
Fixed device enumeration
parent
52a34664
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
example/main.cpp
+4
-3
4 additions, 3 deletions
example/main.cpp
with
4 additions
and
3 deletions
example/main.cpp
+
4
−
3
View file @
31cb1fc5
...
@@ -65,7 +65,7 @@
...
@@ -65,7 +65,7 @@
#include
<float.h>
#include
<float.h>
#define eps_avg 10.0
#define eps_avg 10.0
#define MAX_DEVICES 16
#define MAX( _a, _b) ((_a)>(_b)?(_a) : (_b))
#define MAX( _a, _b) ((_a)>(_b)?(_a) : (_b))
typedef
enum
{
typedef
enum
{
...
@@ -719,7 +719,7 @@ int main (int argc, char * const argv[]) {
...
@@ -719,7 +719,7 @@ int main (int argc, char * const argv[]) {
clFFT_DataFormat
dataFormat
=
clFFT_SplitComplexFormat
;
clFFT_DataFormat
dataFormat
=
clFFT_SplitComplexFormat
;
clFFT_Dimension
dim
=
clFFT_1D
;
clFFT_Dimension
dim
=
clFFT_1D
;
clFFT_TestType
testType
=
clFFT_OUT_OF_PLACE
;
clFFT_TestType
testType
=
clFFT_OUT_OF_PLACE
;
cl_device_id
device_ids
[
16
];
cl_device_id
device_ids
[
MAX_DEVICES
];
FILE
*
paramFile
;
FILE
*
paramFile
;
...
@@ -741,6 +741,7 @@ int main (int argc, char * const argv[]) {
...
@@ -741,6 +741,7 @@ int main (int argc, char * const argv[]) {
printf
(
"ERROR: clGetPlatformIDs failed with error: %d
\n
"
,
status
);
printf
(
"ERROR: clGetPlatformIDs failed with error: %d
\n
"
,
status
);
return
-
1
;
return
-
1
;
}
}
if
(
0
<
numPlatforms
)
{
if
(
0
<
numPlatforms
)
{
cl_platform_id
*
platforms
=
new
cl_platform_id
[
numPlatforms
];
cl_platform_id
*
platforms
=
new
cl_platform_id
[
numPlatforms
];
status
=
clGetPlatformIDs
(
numPlatforms
,
platforms
,
NULL
);
status
=
clGetPlatformIDs
(
numPlatforms
,
platforms
,
NULL
);
...
@@ -789,7 +790,7 @@ int main (int argc, char * const argv[]) {
...
@@ -789,7 +790,7 @@ int main (int argc, char * const argv[]) {
printf
(
"INFO: Using OpenCL platform provided by: %s
\n
"
,
vendor
);
printf
(
"INFO: Using OpenCL platform provided by: %s
\n
"
,
vendor
);
}
}
err
=
clGetDeviceIDs
(
platform
,
device_type
,
sizeof
(
device_ids
)
,
device_ids
,
&
num_devices
);
err
=
clGetDeviceIDs
(
platform
,
device_type
,
MAX_DEVICES
,
device_ids
,
&
num_devices
);
if
(
err
)
if
(
err
)
{
{
printf
(
"ERROR: clGetDeviceIDs failed with error: %d
\n
"
,
err
);
printf
(
"ERROR: clGetDeviceIDs failed with error: %d
\n
"
,
err
);
...
...
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