Create Frequency of Items

Good afternoon! I am a college student,
I wonder if anyone could help me in a problem.
I have to create a structure of A [N] from <string P, int Y>!

Vector Example A
Thread 0 “Cat”, 3 "
Thread 1 {“Dog”, 4}
Thread 2 “Cat”, 5 "}
Thread 3 (“Hamister”, 6)
Thread 4 {“Dog”, 1}
Thread 5(“Hamister”, 3)

I need to create a GPU frequency in X "allocate 6 thread for the above example, but could how many elements have in vector.

Final example in GPU
0 “Cat”, 8 "
1 {“Dog”, 5}
2 (“Hamister”, 8)