1 /**
2 * Copyright (C) Mellanox Technologies Ltd. 2001-2015.  ALL RIGHTS RESERVED.
3 * Copyright (c) UT-Battelle, LLC. 2015. ALL RIGHTS RESERVED.
4 *
5 * See file LICENSE for terms.
6 */
7 
8 #ifndef TEST_UCP_MEMHEAP_H
9 #define TEST_UCP_MEMHEAP_H
10 
11 #include "ucp_test.h"
12 
13 
14 class test_ucp_memheap : public ucp_test {
15 public:
16     /*
17      * @param [in]  max_size       Maximal size of data to send.
18      * @param [in]  memheap_addr   VA to perform the RMA operation to,
19      * @param [in]  rkey           Memheap remote key.
20      * @param [out] expected_data  What should the memheap contain at the given
21      *                             address after the operation (also can be used
22      *                             as a source/destination data).
23      */
24     typedef void (test_ucp_memheap::* blocking_send_func_t)(entity *e,
25                                                             size_t max_size,
26                                                             void *memheap_addr,
27                                                             ucp_rkey_h rkey,
28                                                             std::string& expected_data);
29 
30     /*
31      * @param [in]  max_size       Maximal size of data to send.
32      * @param [in]  memheap_addr   VA to perform the RMA operation to,
33      * @param [in]  rkey           Memheap remote key.
34      * @param [out] expected_data  What should the memheap contain at the given
35      *                             address after the operation (also can be used
36      *                             as a source/destination data).
37      */
38     typedef void (test_ucp_memheap::* nonblocking_send_func_t)(entity *e,
39                                                                size_t max_size,
40                                                                void *memheap_addr,
41                                                                ucp_rkey_h rkey,
42                                                                std::string& expected_data);
43 
44     static std::vector<ucp_test_param> enum_test_params(const ucp_params_t& ctx_params,
45                                                         const std::string& name,
46                                                         const std::string& test_case_name,
47                                                         const std::string& tls);
48 
49 
50 protected:
51     const static size_t DEFAULT_SIZE  = 0;
52     const static int    DEFAULT_ITERS = 0;
53 
54     void test_blocking_xfer(blocking_send_func_t send, size_t len, int max_iters,
55                             size_t alignment, bool malloc_allocate, bool is_ep_flush);
56 
57     void test_nonblocking_implicit_stream_xfer(nonblocking_send_func_t send,
58                                                size_t len, int max_iters,
59                                                size_t alignment, bool malloc_allocate,
60                                                bool is_ep_flush);
61 };
62 
63 
64 #endif
65