implementing occlusion query/hierarchial depth culling in compute shader

I am looking for the tutorial or procedure for implementing occulsion queries in compute shader. What is the algorithm for this?

Here are a couple of links that I’ve used and implemented successfully:

http://malideveloper.arm.com/resources/sample-code/occlusion-culling-hierarchical-z/

I’m using a mixture of both to modify an indirect command buffer by culling based on an entity’s bounding sphere sourced from another SSBO (that also contains all the other model data: matrices, materials, etc).
I’d recommend,at first, just flagging occluded entities and checking that flag in the main rendering pass and do something that stands out if the node should be occluded (e.g. scale the model 20 times) so you know that you are occluding correctly.