fixed segfault in amd implmentation