Converting STD::MAP to array

Dear all,

i dont know if this is the proper section to ask my question.
my question is . i have a c++ code that uses the map/ unordered map which i need to convert it to GPU/ CUDA code.
here is the code.
list::iterator it = values.begin();
advance(it, start);
unordered_map<string, double> myMap;

for (int i = start; i < end; i++) {
    
  string sequence = *it;
  
  unordered_map<string,double>::iterator iter;
  iter=myMap.find(sequence);
  if(iter == myMap.end())
  {
      myMap.insert(make_pair(sequence,1));
  }
  else
  {
      iter->second++;
  }
  it++;
}  // for

if (subsequence == 2) {
  k = myMap.size();
}

this function basically count occurrences of each element in a vector and save them in std::map. and run in O(n).

when i start thinking of converting to cuda, there is no mapping data structure in cuda, so i have to mimic its fuctions, then i said the best way is to sort vector elements (O(nlogn) ) then find the unique values( O(n) so it will take more time than serial code. (in other words, sort and reduce)
afterwards, i decide to keep this part not paralleled and keep running on CPU. and take to output of this section of code and put it as cuda function parameter, but then i discover that i cannot pass the STD::MAP to the cuda. and the solution is to convert the map into array.

any way to solve this dilemma? please help.