File tree 2 files changed +9
-7
lines changed
2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ function VectorAdd() {
25
25
console . info ( "Platform " + i + ": " + cl . getPlatformInfo ( platforms [ i ] , cl . PLATFORM_NAME ) ) ;
26
26
var platform = platforms [ 0 ] ;
27
27
28
- var devices = cl . getDeviceIds ( platform , cl . DEVICE_TYPE_ALL ) ;
28
+ var devices = cl . getDeviceIDs ( platform , cl . DEVICE_TYPE_ALL ) ;
29
29
for ( var i = 0 ; i < devices . length ; i ++ )
30
30
console . info ( " Devices " + i + ": " + cl . getDeviceInfo ( devices [ i ] , cl . DEVICE_NAME ) ) ;
31
31
@@ -34,7 +34,9 @@ function VectorAdd() {
34
34
// var context = cl.createContextFromType(
35
35
// [cl.CONTEXT_PLATFORM, platform],
36
36
// cl.DEVICE_TYPE_GPU);
37
- var context = cl . createContext ( platform , devices ) ;
37
+ var context = cl . createContext ( [
38
+ cl . CONTEXT_PLATFORM , platform ] ,
39
+ devices ) ;
38
40
39
41
console . info ( "created context" ) ;
40
42
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ namespace opencl {
15
15
// cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
16
16
NAN_METHOD (CreateContext) {
17
17
Nan::EscapableHandleScope scope;
18
- REQ_ARGS (4 )
18
+ REQ_ARGS (2 )
19
19
Local<Array> properties;
20
20
Local<Array> devices;
21
21
Local<Function> callback;
@@ -25,7 +25,7 @@ NAN_METHOD(CreateContext) {
25
25
cl_context ctx=NULL ;
26
26
int err=CL_SUCCESS;
27
27
28
- // Arg 1 -- properties
28
+ // Arg 0 -- properties
29
29
if (ARG_EXISTS (0 )) {
30
30
REQ_ARRAY_ARG (0 , properties);
31
31
for (uint32_t i=0 ; i < properties->Length (); i++) {
@@ -39,7 +39,7 @@ NAN_METHOD(CreateContext) {
39
39
cl_properties.push_back (0 );
40
40
}
41
41
42
- // Arg 2 -- devices
42
+ // Arg 1 -- devices
43
43
if (ARG_EXISTS (1 )) {
44
44
REQ_ARRAY_ARG (1 , devices);
45
45
for (uint32_t i=0 ; i<devices->Length (); i++) {
@@ -49,12 +49,12 @@ NAN_METHOD(CreateContext) {
49
49
}
50
50
}
51
51
52
- // Arg 3 -- Callback
52
+ // Arg 2 -- Callback
53
53
if (ARG_EXISTS (2 )) {
54
54
callback = Local<Function>::Cast (info[2 ]);
55
55
}
56
56
57
- // Arg 4 -- Error callback
57
+ // Arg 3 -- Error callback
58
58
if (ARG_EXISTS (3 )) {
59
59
err_cb = Local<Function>::Cast (info[3 ]);
60
60
}
You can’t perform that action at this time.
0 commit comments