Flexible Photonic Memory Pooling Architecture For Efficient Compute Resource Allocation