Contention-Aware GPU Partitioning and Task-to-Partition Allocation for Real-Time Workloads