Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

where can I see the openCL file? #56

Open
JulyJohn opened this issue Oct 24, 2017 · 3 comments
Open

where can I see the openCL file? #56

JulyJohn opened this issue Oct 24, 2017 · 3 comments

Comments

@JulyJohn
Copy link

after compile with "cocl”, like “cocl_py cuda_sample.cu”.I only get a binary executable file "cuda_sample".
but is it possible that I could see the openCL source code (.cl file) at somewhere?

@hughperkins
Copy link
Owner

Well.. the opencl is generated at runtime, not at compile time. This is because we only find out a lot of key type and address space information at runtime.

You can dump the opencl files at runtime though, by doing export COCL_DUMP_CL=1, see https://github.com/hughperkins/coriander/blob/master/doc/options.md

@JulyJohn
Copy link
Author

JulyJohn commented Oct 25, 2017

ok..thanks a lot !
besides, suppose I don't have any gpus, and I want to run it on a cpu, how can I change the config from gpu to cpu? Surely I know it might encounter some problems, but I still want to give it a try :-P

Since in your another project : https://github.com/hughperkins/tf-coriander/ , I have tried it on a cpu, and it does work.

thanks for your attention~

@hughperkins
Copy link
Owner

What do you mean by 'run on a cpu'? Coriander will work only on OpenCL 1.2 devices. If you want to run it on an OpenCL 1.2 CPU, bearing in mind it wont actually run, because the workgroup sizes are too big, but if you want to tweak the workgroup sizes, you'd need to hack on this line, https://github.com/hughperkins/coriander/blob/master/src/cocl_context.cpp#L43

       cocl::CoclDevice *coclDevice = cocl::getCoclDeviceByGpuOrdinal(gpuOrdinal);

which calls into https://github.com/hughperkins/coriander/blob/master/src/cocl_device.cpp#L108-L120

...and modify something about this so it can return CPU OpenCL devices, instead of just GPU OpenCL devices. As you state, this wont work very well though, and you'll need to hack around with workgroup sizes and so on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants