Skip to content

Tool to compile .cl files #38

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

Closed
alalek opened this issue Dec 1, 2018 · 10 comments
Closed

Tool to compile .cl files #38

alalek opened this issue Dec 1, 2018 · 10 comments

Comments

@alalek
Copy link

alalek commented Dec 1, 2018

Question or feature request.

Is there tool (build target) in this repository which can be used to compile .cl files into ISA.

At least it is necessary to simplify "git bisect" work (no need to search compatible runtime and recompile it too).

Currently found these tools:

  • iga64 - assembler tool (doesn't know about .cl)
  • GenX_IR - it knows some H/W platforms, but no any public guides how to use it.

Need tool similar to cloc (renamed ocloc), but without requirement of compatible OpenCL runtime?

Expected input for such tool:

  • .cl kernel source
  • OpenCL build options
  • H/W platform options / config files (Gen9 for Skylake)

Expected output format:

  • low-level, binary/text form compatible with iga64 tool

Also please consider adding some basic subset of tests for IGC.

@PiotrRozenfeld
Copy link

Need tool similar to cloc (renamed ocloc), but without requirement of compatible OpenCL runtime?

Could you clarify why? ocloc has a build-time dependency on NEO (to make sure we have consistent behavior between offline and online compilation), but there is no run-time dependency on igdrcl.so

@paigeale
Copy link
Contributor

Thank you @alalek for the request. We are looking into the feasibility of this internally and will get back to you shortly.

@xuchongyang1995
Copy link

@paigeale @AnupamaChandrasekhar
Hi, I also want to know how can I use igc to compile openCL .cl files into binary that can run both on CPU and GPU without using intel's openCL runtime.
I have searched on Internet and Intel’s documentation site, but I can't find any docs about how to use igc. Could you please give me some instructions/documentations about how to use igc?

@cmc-rep
Copy link

cmc-rep commented Mar 29, 2019

Not sure what you mean, compiled OpenCL kernel cannot run without runtime supports: enqueue kernel, setup memory etc.

@alalek
Copy link
Author

alalek commented Mar 29, 2019

Original problem is a regression of Intel OpenCL releases (3 week releases in a row).
Issue has been filled in compute-runtime repository: intel/compute-runtime#117

But capturing of kernel ISA and disassembling shows regressions from IGC side.
So it is not runtime direct issue. Normally such issues should be filled against IGC code.

I would like to perform "bisect" work myself, to find commits which cause changes/regressions. And to prepare minimal reproducer for IGC only (good reproducers don't require external dependencies, in this case - it is compute-runtime).

But:

  • standalone OpenCL kernel compiler is missing here (or some lack of instructions how to "cook" LLVM to grab results)
    For example, to use ocloc from runtime, for each commit from IGC, you need to have compatible commit from compute-runtime to build ocloc tool - it is a real pain (without any guarantee of success).
    (Actually I didn't use ocloc to grab kernel binary code)
  • there are no tests (there is no way to publish all tests (due possible support of non-released H/W), but some public subset of tests would be nice to have).
    To avoid regressions in the future I would like to propose some test using some tests examples.

I hope the reasons of this request are more clear now.

@xuchongyang1995
Copy link

xuchongyang1995 commented Apr 1, 2019

Not sure what you mean, compiled OpenCL kernel cannot run without runtime supports: enqueue kernel, setup memory etc.

Hi, @cmc-rep I hope the following question is more clear:

  • Is there a stand-alone igc than can compile OpenCL kernel(.cl files) rather than using runtime interface clCreateProgramWithSource(), clBuildProgram()?
  • Can complied OpenCL kernel, a single compiled binary, run both on CPU and GPU( with some runtime support)?

@paigeale
Copy link
Contributor

paigeale commented Apr 9, 2019

Hello alalek/xuchongyang1995,

After conferring internally with the compute runtime team and the IGC team we have decided to keep the existing ocloc tool as the only tool we use to compile OpenCL code. Though we have agreed on making changes to loosen the dependency that the runtime and IGC have. I will update this thread when this interface change has been made in ocloc. This should allow for the swapping of compiler libraries in the future. I appreciate your patience.

Thanks,
Alex

@paigeale
Copy link
Contributor

@jchodor,

Could you confirm that the changes for loosening the dependencies between NEO and IGC are available in latest release?

Thanks,
Alex

@jchodor
Copy link
Contributor

jchodor commented Jun 12, 2019

@paigeale,

it's not in latest release yet (could be in the next one though). Here's the commit : intel/compute-runtime@425dad3.

Small clarification/disclaimer : this loosens dependency between ocloc and IGC, not between NEO and IGC.

@paigeale
Copy link
Contributor

@alalek,

The changes from @jchodor appear to now be released to loosen the dependency between ocloc and IGC (ie looser dependency on ocl patch tokens, and not always loading the fcl). Closing this issue. If there is any other problems encountered using ocloc let us know and we can address those.

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

6 participants