Posts

Post not yet marked as solved
5 Replies
676 Views
Hi, I have an iOS app that interacts with a USB accessory. This works fine when running on an iPhone or iPad. However, when I compile the app in Xcode to run on my M1 Mac, the app won't see any USB devices. The target I use is "My Mac (designed for iPad)" which was the path of least resistance when compared to trying Catalyst. Is it possible to give my app access to USB accessories when running on my Mac? If so, what settings do I need to change? I've tried setting the "com.apple.security.device.usb" entitlement to true to no avail. Is the issue that the app is running in some sort of sandbox?
Posted
by randomx92.
Last updated
.
Post not yet marked as solved
0 Replies
407 Views
I have the following Metal kernel that simply adds two arrays (size Nx*Ny) in parallel: kernel void add_arrays(device const float* inA, device const float* inB, device float* result, uint tid [[thread_position_in_grid]]) { const unsigned int Nx = 1024*5; const unsigned int Ny = 128*5; /* Contiguous memory access in SIMD-group */ uint x = tid % Nx; uint y = tid / Nx; uint index = y * Nx + x; /* Strided memory access in SIMD-group */ /* uint x = tid / Ny; uint y = tid % Ny; uint index = x * Ny + y; */ result[index] = inA[index] + inB[index]; } As a newcomer to Metal coming from CUDA, I expected much worse performance from the strided memory access when compared to contiguous access. However, both versions run in about the same time on average (~80 usec) on my M1 Max. Does this make sense? I have another more complicated kernel where strided access is actually 30% faster than contiguous access. I'd have expected that it would be preferable for SIMD-groups to access contiguous memory locations. Am I missing something as to how the SIMD-group is organized on Apple silicon?
Posted
by randomx92.
Last updated
.
Post not yet marked as solved
1 Replies
837 Views
Hi, I have an application that uses Metal compute kernels to do image processing and it is not built as an Xcode project. Is there a tool to attach or launch a process to profile the scheduling and execution of Metal kernels similar to CUDA's Nsight Systems (or visual profiler)? I want to see the information like kernel execution sequence, duration, kernel names, thread group size, etc. Is that possible to do without an Xcode project? I tried the Instruments tool, but it didn't seem to show the labeled compute kernels. Thanks!
Posted
by randomx92.
Last updated
.