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

how to load the bin file in the library you made #1

Open
zofoc opened this issue Apr 13, 2022 · 4 comments
Open

how to load the bin file in the library you made #1

zofoc opened this issue Apr 13, 2022 · 4 comments

Comments

@zofoc
Copy link

zofoc commented Apr 13, 2022

Hello, I have a question to ask. Why didn't I see the way to load the bin file in the library you made. Only see how to load the source text

@luxidea
Copy link
Member

luxidea commented Apr 13, 2022

Thanks for the question.
My library does not yet support loading binaries.
However, there is an API called "clCreateProgramWithBinary," so loading binaries is possible.
You should be able to implement it by replacing "clCreateProgramWithSource," which is used within the "CreateHandle" method of the "TCLProgra" class.
I will try my hand at it soon.

function TCLProgra<TCLSystem_,TCLPlatfo_,TCLContex_,TCLProgras_>.CreateHandle :T_cl_int;
var
   C :P_char;
begin
     C := P_char( AnsiString( _Source.Text ) );

     _Handle := clCreateProgramWithSource( TCLContex<TCLSystem_,TCLPlatfo_>( Contex ).Handle, 1, @C, nil, @Result );
end;

@zofoc
Copy link
Author

zofoc commented Apr 13, 2022

  Thank you very much for your answer. I'll try some according to your idea tomorrow Can I save the binary kernel modules that have been compiled successfully at the same time? Thank you for your reply.

@luxidea
Copy link
Member

luxidea commented Apr 13, 2022

The API called "clGetProgramInfo" allows you to get the compiled binary after building the text source.
This implementation seems easy and I will give it a try.

@zofoc
Copy link
Author

zofoc commented Apr 14, 2022

I tried several times and failed. I hope you have time to study it. I'm not very familiar with OpenCL

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