def METHOD_NAME(self):
    '''Set the build options [pre-compile hook].
    This hook requires the ``gpu_build`` variable to be set.
    The supported options are ``'cuda'`` and ``'hip'``. See the
    vendor-specific docs for the supported options for the ``gpu_arch``
    variable.
    '''
    if self.gpu_build == 'cuda':
        self.build_system.makefile = 'makefile.cuda'
        if self.gpu_arch:
            self.build_system.cxxflags += [
                f'-arch=compute_{self.gpu_arch}',
                f'-code=sm_{self.gpu_arch}'
            ]
    elif self.gpu_build == 'hip':
        self.build_system.makefile = 'makefile.hip'
        if self.gpu_arch:
            self.build_system.cxxflags += [
                f'--amdgpu-target={self.gpu_arch}'
            ]
    else:
        raise ValueError('unknown gpu_build option')