Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Metal kernel: unknown attribute 'global_id' ignored

I am trying to create a kernel based on WWDC session 605:


#include <metal_stdlib>
using namespace metal;

kernel void downsizeColor(texture2d<short, access::sample> inputImage [[ texture(0) ]],
                          texture2d<short, access::write> resizedImage [[ texture(1) ]],
                          uint2 coords [[ global_id ]])
{


}

but I get a warning as per the title and it errors out on coords. Is global_id supposed to be substituted with something? I cannot find any other example apart from that pseudocode.

iPhone 6, iOS 8.1.3

Posted on Mar 4, 2015 10:04 PM

Reply
2 replies

Mar 4, 2015 11:20 PM in response to v0n0

According to sample code, I changed to:


kernelvoid downsizeColor(texture2d<short, access::sample> inputImage [[ texture(0) ]],

texture2d<short, access::write> resizedImage [[ texture(1) ]],

uint2 gid [[ thread_position_in_grid ]])

{

}

and it compiles, but this implies I have groups of size 1. If I want to resize to a non-integer fraction, don't know if that will work?

Metal kernel: unknown attribute 'global_id' ignored

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.