Giter Site home page Giter Site logo

gocl's Introduction

"We choose to use Rust, not because it is easy, but because it is hard, because that goal will serve to organize and measure the best of our energies and skills, because that challenge is one that we are willing to accept, one we are unwilling to postpone, and one which we intend to win, and the others, too."

"Any application that can be written in Rust, will eventually be written in Rust."

gocl's People

Contributors

jolan avatar oliverbrandt avatar rainliu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

gocl's Issues

build error

I encountered the following error:

$ go build -tags="cl20" github.com/rainliu/gocl/cl

github.com/rainliu/gocl/cl

go/src/github.com/rainliu/gocl/cl/image12.go:47: c_image_desc.buffer undefined (type C.struct__cl_image_desc has no field or method buffer)
go/src/github.com/rainliu/gocl/cl/queue20.go:39: cannot use c_properties_ptr (type *C.cl_command_queue_properties) as type *C.cl_queue_properties in argument to _Cfunc_clCreateCommandQueueWithProperties

I'm using AMD-APP-SDK-v3.0.124.132-GA-linux64.sh and fglrx-14.502.1040 on a FirePro W7100.
My environment looks like this:
$ cat /etc/profile.d/AMDAPPSDK.sh
export AMDAPPSDKROOT=/opt/AMDAPPSDK-3.0
export AMDAPPSDKROOT=/opt/AMDAPPSDK-3.0
export LD_LIBRARY_PATH="/opt/AMDAPPSDK-3.0/lib/x86_64/"
export CGO_CFLAGS=-I$AMDAPPSDKROOT/include
export CGO_LDFLAGS=-L$AMDAPPSDKROOT/lib/x86_64

Any help would be greatly appreciated!

heavy memory leak when run in a loop

We noticed that our gominer project that uses your library leaks memory in proportion to how fast the main loop is running on the device.

I was able to reproduce the issue by forcing one of the demos to run in a loop:

master...jolan:jolan_memleak

It leaks about 1MB/s on my machine. Looking through the source code there's only a few files that are freeing any memory. Unfortunately, I'm not very well versed in C/cgo memory management but will start digging to see if I can help fix this.

build error

Hi, I have this errors trying to compile golc

$go build -tags="cl12" gocl/ocl

gocl/cl/kernel1x.go: In function ‘_cgo_3df5c9c5fde2_Cfunc_clEnqueueTask’:
gocl/cl/kernel1x.go:53:2: warning: ‘clEnqueueTask’ is deprecated (declared at /usr/include/CL/cl.h:1367) [-Wdeprecated-declarations]
  if event != nil {
  ^

I'm using intel_sdk_for_ocl_applications_2014_4.6.0.92_x64
and my environment is

export intelappsdkroot=/opt/intel/opencl-1.2-sdk-4.6.0.92
export CGO_LDFLAGS=-L$intelappsdkroot/lib64
export CGO_CFLAGS=-l$intelappsdkroot/include

maybe you can help me
Thank you

Constants not available in OpenCL 1.1

Hi, im trying to get gocl working in windows with Nvidia.
cl.go seems to be defining a lot of constants that are only defined in OpenCL 1.2 and thus breaking compilation as they are not defined in cl.h

Just a few:
37: error: 'CL_KERNEL_ARG_TYPE_QUALIFIER' undeclared (first use in this function)
37: error: 'CL_DEVICE_PARTITION_TYPE' undeclared (first use in this function)
38: error: 'CL_BLOCKING' undeclared (first use in this function)
38: error: 'CL_KERNEL_ARG_NAME' undeclared (first use in this function)
38: error: 'CL_UNORM_INT24' undeclared (first use in this function)
38: error: 'CL_IMAGE_ARRAY_SIZE' undeclared (first use in this function)
38: error: 'CL_DEVICE_PARTITION_BY_COUNTS_LIST_END' undeclared (first use in this function)
38: error: 'CL_DEVICE_AFFINITY_DOMAIN_L4_CACHE' undeclared (first use in this function)
38: error: 'CL_DEVICE_BUILT_IN_KERNELS' undeclared (first use in this function)
38: error: 'CL_DEVICE_IMAGE_PITCH_ALIGNMENT' undeclared (first use in this function)
38: error: 'CL_PROGRAM_BINARY_TYPE_COMPILED_OBJECT' undeclared (first use in this function)
38: error: 'CL_COMMAND_FILL_IMAGE' undeclared (first use in this function)
38: error: 'CL_KERNEL_ARG_INFO_NOT_AVAILABLE' undeclared (first use in this function)
38: error: 'CL_KERNEL_ARG_ACCESS_QUALIFIER' undeclared (first use in this function)
38: error: 'CL_KERNEL_ARG_ACCESS_WRITE_ONLY' undeclared (first use in this function)
38: error: 'CL_KERNEL_ARG_ADDRESS_CONSTANT' undeclared (first use in this function)
38: error: 'CL_INVALID_COMPILER_OPTIONS' undeclared (first use in this function)
38: error: 'CL_DEVICE_AFFINITY_DOMAIN_L2_CACHE' undeclared (first use in this function)
38: error: 'CL_DEPTH_STENCIL' undeclared (first use in this function)
38: error: 'CL_NON_BLOCKING' undeclared (first use in this function)
38: error: 'CL_DEVICE_TYPE_CUSTOM' undeclared (first use in this function)
38: error: 'CL_PROGRAM_BINARY_TYPE_LIBRARY' undeclared (first use in this function)
39: error: 'CL_IMAGE_BUFFER' undeclared (first use in this function)
39: error: 'CL_IMAGE_NUM_MIP_LEVELS' undeclared (first use in this function)
39: error: 'CL_DEVICE_PARTITION_BY_AFFINITY_DOMAIN' undeclared (first use in this function)

Error on my part or missing tags in gocl?

no license present

Hi -- Can you please add some sort of permissive license file/indicator?

Build error with -tags="cl12" or -tags="cl20" on NVidia

It's OK when I do
go build -tags="cl11" gocl/cl

But with -tags="cl12", I encountered the following error:

gocl/cl/image12.go:47: c_image_desc.buffer undefined (type C.struct__cl_image_desc has no field or method buffer)

and with tags="cl20" this

gocl/cl/image12.go:47: c_image_desc.buffer undefined (type C.struct__cl_image_desc has no field or method buffer)
gocl/cl/queue20.go:39: cannot use c_properties_ptr (type *C.cl_command_queue_properties) as type *C.cl_queue_properties in argument to func literal

I'm using Nvidia GT 1030 GPU card on Ubuntu 16.04
With tags="cl11", goclinfo give me this informations

Number of platforms: 	1
	CL_PLATFORM_PROFILE     : FULL_PROFILE
	CL_PLATFORM_VERSION     : OpenCL 1.2 CUDA 9.0.194
	CL_PLATFORM_VENDOR      : NVIDIA Corporation
	CL_PLATFORM_EXTENSIONS  : cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_fp64 cl_khr_byte_addressable_store cl_khr_icd cl_khr_gl_sharing cl_nv_compiler_options cl_nv_device_attribute_query cl_nv_pragma_unroll cl_nv_copy_opts cl_nv_create_buffer

	Number of devices: 	1
		CL_DEVICE_TYPE      : CL_DEVICE_TYPE_GPU
		CL_DEVICE_NAME      : GeForce GT 1030
		CL_DEVICE_VENDOR    : NVIDIA Corporation
		CL_DEVICE_PROFILE   : FULL_PROFILE

I set export CGO_CFLAGS=-I$GOPATH/src/gocl/android/include
My Go environment looks like this:

dev@dev-Veriton-M421G:~/go/src$ go env
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/dev/go"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build006095219=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-I/src/gocl/android/include"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.