tessl install tessl/pypi-cupy-cuda101@9.6.0CuPy: NumPy & SciPy for GPU (CUDA 10.1 version)
Agent Success
Agent success rate when using this tile
87%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.19x
Baseline
Agent success rate without this tile
73%
Build a student grade ranking system that processes and ranks students based on multiple criteria using GPU-accelerated array operations.
You need to implement a function that takes student data (IDs, scores across multiple subjects) and produces a ranked list of students based on a multi-level sorting criteria. The ranking should be performed efficiently using GPU acceleration.
Your solution should accept the following inputs:
student_ids: A 1D array of unique integer student IDssubject_scores: A 2D array where each row represents a subject and each column represents a student's score in that subjectpriority_order: A 1D array specifying the order of subjects for ranking (indices into the rows of subject_scores)Students should be ranked using lexicographic (multi-key) sorting:
Return a 1D array of student IDs in ranked order (best student first).
ranker.py with a function rank_students(student_ids, subject_scores, priority_order)Given student_ids [101, 102, 103, 104] and subject_scores [[85, 92, 85, 88], [90, 85, 88, 90], [88, 88, 92, 85]] with priority_order [0, 1, 2], the function returns [102, 104, 103, 101] @test
Given student_ids [201, 202, 203] with tied scores in the first subject and different scores in subsequent subjects, the function correctly breaks ties using secondary priority subjects @test
Given student_ids [301, 302, 303] and a non-default priority_order [1, 0, 2], the function correctly ranks students according to the specified subject priority @test
Provides GPU-accelerated array computing with NumPy-compatible API for efficient numerical operations.
@satisfied-by
@generates