aboutsummaryrefslogtreecommitdiffstats
path: root/Godeps/_workspace/src/github.com/Gustav-Simonsson/go-opencl/cl/kernel12.go
blob: d9e6f3546edf4376c2dd5951657fe9263338cb2b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// +build cl12

package cl

// #ifdef __APPLE__
// #include "OpenCL/opencl.h"
// #else
// #include "cl.h"
// #endif
import "C"
import "unsafe"

func (k *Kernel) ArgName(index int) (string, error) {
    var strC [1024]byte
    var strN C.size_t
    if err := C.clGetKernelArgInfo(k.clKernel, C.cl_uint(index), C.CL_KERNEL_ARG_NAME, 1024, unsafe.Pointer(&strC[0]), &strN); err != C.CL_SUCCESS {
        return "", toError(err)
    }
    return string(strC[:strN]), nil
}