Attempting to optimize this function with HSA, or any parallelization programming model would require significant changes to the structure of the hash table, and isn't a useful endeavor. Parallelization could be done on the comparison operation in the PTR_NOT_EQUAL macro, i.e. the calculation "(ptr) != 0 && ((ptr)->hash != (hash_val)", but because the table isn't a contiguous block of memory each entry must be traversed to find the next, making parallelization of the search impossible. Any parallelization optimization would require a redesign of the table data structure and how entries are stored.