Skip to content

Commit 159d205

Browse files
committed
Issue #253
auto detect navi cards
1 parent 352dec4 commit 159d205

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

ocl.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,15 @@ _clState *initCl(unsigned int gpu, char *name, size_t nameSize, algorithm_t *alg
244244

245245
applog(LOG_INFO, "Selected %d: %s", gpu, pbuff[gpu]);
246246
strncpy(name, pbuff[gpu], nameSize);
247+
248+
if (strstr(name, "gfx10") != NULL) {
249+
if (strstr(cgpu->algorithm.name, "_navi") == NULL) {
250+
char newname[20] = {0};
251+
strncpy(newname, cgpu->algorithm.name, strlen(cgpu->algorithm.name));
252+
strcat(newname, "_navi");
253+
set_algorithm(&cgpu->algorithm, newname);
254+
}
255+
}
247256

248257
status = create_opencl_context(&clState->context, &platform);
249258
if (status != CL_SUCCESS) {

0 commit comments

Comments
 (0)