Skip to content

Commit

Permalink
Add EIATTR_ANNOTATIONS attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
mikex86 committed Sep 13, 2024
1 parent 4bef39a commit b551b27
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion driverapi/src/librecuda.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -869,6 +869,9 @@ struct RelocInfo {
#define EIATTR_S2RCTAID_INSTR_OFFSETS 0x1d04
#define EIATTR_S2RCTAID_INSTR_OFFSETS_ATTR_BASE_WORD_LEN 1

#define EIATTR_ANNOTATIONS 0x5504
#define EIATTR_ANNOTATIONS_ATTR_BASE_WORD_LEN 1

#define EIATTR_EXTERNS 0x0f04
#define EIATTR_EXTERNS_ATTR_WORD_LEN 2

Expand Down Expand Up @@ -1038,7 +1041,7 @@ libreCudaStatus_t libreCuModuleLoadData(LibreCUmodule *pModule, const void *imag
}

relocs.push_back(RelocInfo{
.apply_image_offset=target_image_off + offset,
.apply_image_offset=static_cast<ELFIO::Elf64_Addr>(target_image_off + offset),
.rel_sym_offset=sym_section_offs + st_value,
.typ=type
});
Expand Down Expand Up @@ -1202,6 +1205,11 @@ libreCudaStatus_t libreCuModuleLoadData(LibreCUmodule *pModule, const void *imag
off += other;
break;
}
case EIATTR_ANNOTATIONS: {
off += EIATTR_S2RCTAID_INSTR_OFFSETS_ATTR_BASE_WORD_LEN * sizeof(NvU32);
off += other;
break;
}
case EIATTR_SW_WAR: {
off += EIATTR_SW_WAR_ATTR_WORD_LEN * sizeof(NvU32);
break;
Expand Down

0 comments on commit b551b27

Please sign in to comment.