Is there a way to get an id of the primitive in a geometry shader?

Is there a way to get the ID of the current primitive in a geometry shader? Like you can do with SV_VertexID for vertices. (Unity - Manual: Shader semantics)
Apparently in DX11 and OpenGL there should be.

I tried SV_PRIMITIVEID and SV_PrimitiveID, and both didnt work.

You should be able to use it like this:

[maxvertexcount(3)]
void geom(triangle VertexOutput input[3], uint pid : SV_PrimitiveID, inout TriangleStream<VertexOutput> OutputStream)
{
    // geometry shader implementation....
}