You can tell if a surface (or canvas) is backed by the CPU implementation of Skia, by calling peekPixels(nullptr). That will return true for the CPU backend, and false for all others. If you want information about which specific GPU backend is used, there are additional queries you could make: SkSurface::recordingContext() will return a non-null GrRecordingContext* if the surface is Ganesh-based. Similarly, ::recorder() will return non-null if Graphite is being used.
Assuming it's Ganesh, then you can call GrRecordingContext::backend() to find out which 3D API is used. There is more information available in the "caps" object, but that's not public API.