Some minor fixes and extensions to CLU#1
Conversation
|
The last commit adds several new functions. I believe they are all worth including. But of course that is up to you. They are documented in the include file. cluGetContextDefaultDevice cluCreateContextByType cluHostMallocPageAligned cluBuildProgramSimple cluRoundUp Tell me what you think. And if you want me to split them into separate commits I can. |
|
Thanks for the patches. For the moment I'm only interested in supporting POSIX-like systems (mostly Linux, but patches to support *BSD systems are equally welcome). I've commented on a few patches, and regarding the last one yes, I'd prefer if you split it: some of it can be trivially merged, other requires some more attention. Two notes you can keep in mind when splitting it:
|
…ic const into #define.
… was called before _cluGetPlatformInfo has been called on a platform.
|
OK I reworked the set of commits. I think this addressed all of your issues with them. cluHostMalloc... is not in a branch. I'll do a first version of the cluMallocHost you talked about (with just one flag PAGE_ALIGNED for the moment) and then merge and push that branch. Tell me if anything else needs to be fixed. I had a thought about the cluGetPlatformByName bug (not reflected in these changes). Maybe just using clGetPlatformInfo directly would be appropriate. Because cluGetPlatformByName will probably only be called once for one platform so the only wasted call in that case would be a single call to clGetPlatformInfo. On the other hard the current method might be just fine. The extra loads will not be an issue because they will only happen once during initialization. But that's up to you. PS: I'm fairly new to git (I'm usually a mercurial guy and even then I'm not that skilled) so I apologize for messing with my commit history. I didn't know any other way to make the changes needed. |
|
Oh and I was thinking about writing a function (or extending the functionality of cluBuildProgramSImple) to allow it to return compiler errors in the case of a build failure. Maybe something as simple as a size_t/char* argument pair that is loaded with build log whether is succeeds or fails. This would avoid the need for people to call clGetProgramInfo separately. Which would help approach the ease of use of CUDA. And people can always use clBuildProgram instead if they like. What do you think? |
|
I've merged some of the commits (and fixed a few whitespace problems when doing it). Here's what I haven't merged yet, and why:
Regarding |
I have fixed a few bugs and added an install target to the make file to make this nice little package easier for me to use. I am also working on some extensions to it that I will push in your direction soon.
Tell me if there are any specific requirements for patches. For instance what platforms do they need to work on?
Thanks.
-Arthur