Yes, there is no need to merge samples for the independence statistic (no kernel between entries from different samples is ever computed). You effectively only need to compute a kernel matrix K on {X_i} and a kernel matrix L on {Y_i} and then use the shuffled indices to access entries in K.