Skip to content

Remove ACL_CONTEXT_MSIM #258

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

Merged
merged 1 commit into from
Jan 31, 2023
Merged
Show file tree
Hide file tree
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
1 change: 0 additions & 1 deletion include/acl_globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ cl_bool acl_init_from_hal_discovery(void);
// Set *use_offline_ret_only = 0
#define ACL_CONTEXT_OFFLINE_AND_AUTODISCOVERY 0
#define ACL_CONTEXT_OFFLINE_ONLY 1
#define ACL_CONTEXT_MSIM 3
#define ACL_CONTEXT_MPSIM 4
const char *acl_get_offline_device_user_setting(int *use_offline_only_ret);

Expand Down
6 changes: 0 additions & 6 deletions include/acl_hal.h
Original file line number Diff line number Diff line change
Expand Up @@ -262,12 +262,6 @@ void acl_reset_hal(void);
extern int debug_mode;
int acl_print_debug_msg(const char *msg, ...);

#ifdef __linux__
/// Each HAL must define this function even if it does nothing at all.
/// Assume that we'll only link to one HAL.
ACL_HAL_EXPORT const acl_hal_t *
acl_msim_get_system_definition(acl_system_def_t *system) WEAK;
#endif
ACL_HAL_EXPORT const acl_hal_t *
acl_mmd_get_system_definition(acl_system_def_t *system,
acl_mmd_library_names_t *_libraries_to_load);
Expand Down
3 changes: 1 addition & 2 deletions include/acl_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -1575,8 +1575,7 @@ typedef struct _cl_platform_id
// any.
std::string offline_device;
// Cache context offline mode specified by environment variables
// CL_CONTEXT_OFFLINE_DEVICE_INTELFPGA, CL_CONTEXT_MPSIM_DEVICE_INTELFPGA
// or CL_CONTEXT_MSIM_DEVICE_INTELFPGA
// CL_CONTEXT_OFFLINE_DEVICE_INTELFPGA or CL_CONTEXT_MPSIM_DEVICE_INTELFPGA
int offline_mode;

// Should we track and automatically release leaked objects?
Expand Down
24 changes: 0 additions & 24 deletions src/acl_globals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,22 +117,6 @@ const char *acl_get_offline_device_user_setting(int *use_offline_only_ret) {
if (setting) {
use_offline_only = ACL_CONTEXT_MPSIM;
result = setting;
} else {
setting = acl_getenv("CL_CONTEXT_MSIM_DEVICE_INTELFPGA");
setting_deprecated = acl_getenv("CL_CONTEXT_MSIM_DEVICE_ALTERA");
if (!setting && setting_deprecated) {
setting = setting_deprecated;
if (0 == warn_depr3) {
fprintf(stderr, "[Runtime Warning]: CL_CONTEXT_MSIM_DEVICE_ALTERA "
"has been deprecated. Use "
"CL_CONTEXT_MSIM_DEVICE_INTELFPGA instead.\n");
warn_depr3 = 1;
}
}
if (setting) {
use_offline_only = ACL_CONTEXT_MSIM;
result = 0;
}
}
}

Expand Down Expand Up @@ -186,14 +170,6 @@ cl_bool acl_init_from_hal_discovery(void) {
case ACL_CONTEXT_OFFLINE_ONLY:
board_hal = acl_get_offline_hal();
break;
#ifdef __linux__
case ACL_CONTEXT_MSIM:
if (&acl_msim_get_system_definition == NULL) {
return CL_FALSE;
}
board_hal = acl_msim_get_system_definition(&builtin_prog_def_value);
break;
#endif
default:
// Not a valid setting so don't know which HAL to load
return CL_FALSE;
Expand Down
7 changes: 2 additions & 5 deletions src/acl_platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -390,9 +390,6 @@ void acl_init_platform(void) {
// offline device, if it exists
break;
case ACL_CONTEXT_MPSIM:
#ifdef __linux__
case ACL_CONTEXT_MSIM:
#endif
acl_platform.num_devices =
acl_platform.initial_board_def
->num_devices; // Simulator has its mmd, so it is loaded like an
Expand Down Expand Up @@ -660,10 +657,10 @@ static void l_initialize_devices(const acl_system_def_t *present_board_def,
// shipped_board_def populated earlier in l_initialize_offline_devices

if (offline_mode == ACL_CONTEXT_OFFLINE_AND_AUTODISCOVERY ||
offline_mode == ACL_CONTEXT_MSIM || offline_mode == ACL_CONTEXT_MPSIM) {
offline_mode == ACL_CONTEXT_MPSIM) {
unsigned int num_platform_devices = acl_platform.num_devices;
if (!acl_platform.offline_device.empty() &&
offline_mode != ACL_CONTEXT_MSIM && offline_mode != ACL_CONTEXT_MPSIM) {
offline_mode != ACL_CONTEXT_MPSIM) {
num_platform_devices -=
1; // In this case there's an extra offline devices at the end of the
// list. Do not check it.
Expand Down