@@ -9,62 +9,48 @@ struct urProgramLinkTest : uur::urProgramTest {
9
9
void SetUp () override {
10
10
UUR_RETURN_ON_FATAL_FAILURE (urProgramTest::SetUp ());
11
11
ASSERT_SUCCESS (urProgramCompile (context, program, nullptr ));
12
- programs.push_back (program);
13
-
14
- uur::KernelsEnvironment::instance->LoadSource (" bar" , 0 , bar_binary);
15
- ASSERT_SUCCESS (urProgramCreateWithIL (context, bar_binary->data (),
16
- bar_binary->size (), nullptr ,
17
- &bar_program));
18
- ASSERT_SUCCESS (urProgramCompile (context, bar_program, nullptr ));
19
- programs.push_back (bar_program);
20
12
}
21
13
22
14
void TearDown () override {
23
- if (bar_program) {
24
- EXPECT_SUCCESS (urProgramRelease (bar_program));
25
- }
26
15
if (linked_program) {
27
16
EXPECT_SUCCESS (urProgramRelease (linked_program));
28
17
}
29
18
UUR_RETURN_ON_FATAL_FAILURE (urProgramTest::TearDown ());
30
19
}
31
20
32
- ur_program_handle_t bar_program = nullptr ;
33
21
ur_program_handle_t linked_program = nullptr ;
34
- std::shared_ptr<std::vector<char >> bar_binary;
35
- std::vector<ur_program_handle_t > programs;
36
22
};
37
23
UUR_INSTANTIATE_KERNEL_TEST_SUITE_P (urProgramLinkTest);
38
24
39
25
TEST_P (urProgramLinkTest, Success) {
40
- ASSERT_SUCCESS (urProgramLink (context, programs. size (), programs. data (),
41
- nullptr , &linked_program));
26
+ ASSERT_SUCCESS (
27
+ urProgramLink (context, 1 , &program, nullptr , &linked_program));
42
28
ur_program_binary_type_t binary_type = UR_PROGRAM_BINARY_TYPE_NONE;
43
29
ASSERT_SUCCESS (urProgramGetBuildInfo (
44
- program, device, UR_PROGRAM_BUILD_INFO_BINARY_TYPE, sizeof (binary_type),
45
- &binary_type, nullptr ));
30
+ linked_program, device, UR_PROGRAM_BUILD_INFO_BINARY_TYPE,
31
+ sizeof (binary_type), &binary_type, nullptr ));
32
+ ASSERT_EQ (binary_type, UR_PROGRAM_BINARY_TYPE_EXECUTABLE);
46
33
}
47
34
48
35
TEST_P (urProgramLinkTest, InvalidNullHandleContext) {
49
- ASSERT_EQ_RESULT (UR_RESULT_ERROR_INVALID_NULL_HANDLE,
50
- urProgramLink ( nullptr , programs. size (), programs. data () ,
51
- nullptr , &linked_program));
36
+ ASSERT_EQ_RESULT (
37
+ UR_RESULT_ERROR_INVALID_NULL_HANDLE ,
38
+ urProgramLink ( nullptr , 1 , &program, nullptr , &linked_program));
52
39
}
53
40
54
41
TEST_P (urProgramLinkTest, InvalidNullPointerProgram) {
55
42
ASSERT_EQ_RESULT (UR_RESULT_ERROR_INVALID_NULL_POINTER,
56
- urProgramLink (context, programs.size (), programs.data (),
57
- nullptr , nullptr ));
43
+ urProgramLink (context, 1 , &program, nullptr , nullptr ));
58
44
}
59
45
60
46
TEST_P (urProgramLinkTest, InvalidNullPointerInputPrograms) {
61
- ASSERT_EQ_RESULT (UR_RESULT_ERROR_INVALID_NULL_POINTER,
62
- urProgramLink (context, programs. size (), nullptr , nullptr ,
63
- &linked_program));
47
+ ASSERT_EQ_RESULT (
48
+ UR_RESULT_ERROR_INVALID_NULL_POINTER ,
49
+ urProgramLink (context, 1 , nullptr , nullptr , &linked_program));
64
50
}
65
51
66
52
TEST_P (urProgramLinkTest, InvalidSizeCount) {
67
53
ASSERT_EQ_RESULT (
68
54
UR_RESULT_ERROR_INVALID_SIZE,
69
- urProgramLink (context, 0 , programs. data () , nullptr , &linked_program));
55
+ urProgramLink (context, 0 , &program , nullptr , &linked_program));
70
56
}
0 commit comments