Cut/Move the com.unity.memprofiler folder from /Library/PackageCache to /Packages and remove the com.unity.memprofiler entry from the manifest in the same folder. This prevents PackageManager to reset any changes you make and lets you edit the code normally.
Under Packages/com.unity.memprofiler.../Editor/UI, edit SelectedItemDetailsForTypesAndObjects.cs
Add the following usings:
using UnityEngine.Rendering;
using UnityEngine.Experimental.Rendering;