Posts

Post not yet marked as solved
0 Replies
789 Views
Please review the following description provided in a bug report for the above-referenced sample code, and then suggest a workaround: Summary: There is an error when attempting to compile the sample code project, “Performing Calculations on a GPU.” Even after omitting the offending code, the out buffer does not return the value calculated by the compute kernel. Steps to Reproduce: Download the sample code project from: https://developer.apple.com/documentation/metal/learning_basic_tasks_in_metal/performing_calculations_on_a_gpu Attempt to build and run the project with Xcode, and note the error reported in the LLDB console. Comment the thread group-related code in the implementation source, and omit it in the compute kernel in the shader source Build and run the project, and note the absence of any error EXCEPT THE RUNTIME ASSERTION THAT IS TRIGGERED WHEN THE SUM STORED IN THE OUT BUFFER DOES NOT EQUAL THE SUM OF THE TWO VALUES STORED IN THE IN BUFFERS. Attempt to store the sum calculated by the compute kernel, and access it from the implementation source (e.g., output the sum to the console using NSLog or printf). Expected Results: The project should compile without warning or error; the value calculated by the compute kernel should be stored and made readable using the address pointer referenced by the contents property of MTLBuffer by the CPU Actual Results: The compiler reports an error in the block of code that creates and encodes thread groups-related instructions for the command encoder; the value that is the sum stored and referenced by the compute kernel in the out buffer always equals 0.0. NOTE | A next-day attempt to build the project with the code intact failed to reproduce this error; however, the sum returned is always 0.0. Version/Build: The sample code was downloaded from the production version of the Apple Developer Connection site; the build was attempted using the latest production build of Xcode 10 Configuration: MacBook Pro (late 2016)
Posted Last updated
.