Repository navigation
Conversation
| { | ||
| MTLLibrary metalLibrary; | ||
|
|
||
| Device device; |
There was a problem hiding this comment.
why does the program contain a device?
The program represents the code.
It seems to me that you should split out the concept of a kernel from its binding to a pipeline state object.
| // TODO(asadbek): explore options to make the use of async execution with events | ||
| this (Device _device /*bool async*/) | ||
| { | ||
| device = _device; |
There was a problem hiding this comment.
device is unused outside of the constructor, why cache a reference to it in the Queue?
There was a problem hiding this comment.
I don't know how to encode it in other way, I used device within enqueue method's OpCall which makes it functor type of function, I can add a new parameter to get the device but I thought it would be nice to encode it as field instead of another parameter in the enqueue function
… Queue as it fits better there and store MTLFunction in kernel metadata instead
510f88d to
e6c7d60
Compare
| if (kernelFunction is null) | ||
| { | ||
| printf("Error: Could not find kernel function %s in library.\n", name); | ||
| assert(0); | ||
| } |
There was a problem hiding this comment.
just assert(kernelFunction, "Error: Could not find kernel function"); the name will already be in the stack trace
There was a problem hiding this comment.
Yes, thanks for the idea. I did not think about using assert.
| { | ||
| auto downgraded_llvm_bitcode_path = downgrade_llvm_bitcode(path); | ||
|
|
||
| if (downgraded_llvm_bitcode_path.isNull) { |
There was a problem hiding this comment.
just replace this with an assert
|
|
||
| auto compiled_metallib_path = metallib_as(downgraded_llvm_bitcode_path.get()); | ||
|
|
||
| if (compiled_metallib_path.isNull) { |
| if (library is null) | ||
| { | ||
| printf("Error loading .metallib: %s\n", error.localizedDescription().ptr); | ||
| assert(0); | ||
| } |
There was a problem hiding this comment.
assert(library, Error loading .metallib");
No description provided.