Experimental study of heavy flavour production at RHIC and LHC