Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add EIATTR_ANNOTATIONS attribute #16

Merged
merged 1 commit into from
Sep 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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